I'm having trouble getting webpack to bundle my scripts. I get an error from this line on app.module.ts: @NgModule({
I get the message: You may need an appropriate loader to handle this file type.
Here's my webpack config:
var ExtractTextPlugin = require('extract-text-webpack-plugin'); module.exports = { entry: ["./src/ts/main.ts","./src/ts/css.ts"], module: { rules: [ { test: /\.tsx$/, loaders: [ { loader: 'awesome-typescript-loader', options: { configFileName: 'tsconfig.json' } } , 'angular2-template-loader' ] }, { test: /\.css$/, use: ExtractTextPlugin.extract({use: 'css-loader'}) }, { test: /\.(jpe?g|png|gif|svg)$/i, use: ['url-loader?limit=10000', 'img-loader'] }, { test: /\.(eot|woff2?|ttf)$/i, use: 'url-loader' } ] }, resolve: { extensions: [".tsx", ".ts", ".js"] }, plugins: [ new ExtractTextPlugin("public/styles.css"), ], output: { filename: "public/bundle.js" } } Here's tsconfig.json:
{ "compilerOptions": { "target": "es5", "module": "commonjs", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": [ "es2015", "dom" ], "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, "rootDir": "src/ts" }, "angularCompilerOptions": { "genDir": "public/dist/js" }, "exclude": [ "node_modules", "**/*-aot.ts" ], "filesGlob": [ "src/ts/**/*.ts" ] } It gets to app.module.ts through main.ts.