Created
October 26, 2016 15:39
-
-
Save ajcrites/bc8cb18025d7a8c72946d41db6b445d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const webpack = require("webpack"); | |
| const HtmlPlugin = require("html-webpack-plugin"); | |
| const ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
| const helpers = require("./helpers"); | |
| const envPlugin = new webpack.DefinePlugin({ | |
| "ENV": JSON.stringify("bar") | |
| }); | |
| module.exports = { | |
| entry: { | |
| polyfills: "./src/polyfills.ts", | |
| vendor: "./src/vendor.ts", | |
| app: "./src/main.ts", | |
| }, | |
| resolve: { | |
| extensions: ["", ".ts", ".js"] | |
| }, | |
| module: { | |
| plugins: [ | |
| envPlugin | |
| ], | |
| loaders: [ | |
| { | |
| test: /\.ts$/, | |
| loaders: ["awesome-typescript-loader", "angular2-template-loader"], | |
| }, | |
| { | |
| test: /\.html$/, | |
| loader: "html", | |
| }, | |
| { | |
| test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, | |
| loader: "file?name=assets/[name].[hash].[ext]", | |
| }, | |
| { | |
| test: /\.css$/, | |
| exclude: helpers.root("src", "app"), | |
| loader: ExtractTextPlugin.extract("style", "css?sourceMap") | |
| }, | |
| { | |
| test: /\.css$/, | |
| include: helpers.root("src", "app"), | |
| loader: "raw", | |
| }, | |
| ], | |
| }, | |
| plugins: [ | |
| new webpack.optimize.CommonsChunkPlugin({ | |
| name: ["app", "vendor", "polyfills"] | |
| }), | |
| new HtmlPlugin({ | |
| template: "src/index.html", | |
| }), | |
| ], | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue here is that
pluginsis separate frommodule. It would also end up being defined twice.