diff --git a/webpack.config.js b/webpack.config.js index 0d2bff3..d88d95a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,16 +2,19 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const webpack = require('webpack'); -const ConcatPlugin = require('webpack-concat-plugin'); module.exports = { context: path.resolve(__dirname, 'src'), entry: { - "main": [ + main: [ './main.ts' ], - "styles": [ + styles: [ './main.scss' + ], + vendor: [ + 'jquery', + 'materialize-css' ] }, devtool: 'source-map', @@ -115,21 +118,15 @@ module.exports = { }] }, plugins: [ - new ConcatPlugin({ - uglify: false, - sourceMap: true, - useHash: false, - name: "vendor", - fileName: "[name].bundle.js", - filesToConcat: [ - "node_modules/jquery/dist/jquery.min.js", - "node_modules/materialize-css/dist/js/materialize.min.js" - ] + new webpack.optimize.CommonsChunkPlugin({ + name: "vendor" }), new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", - "window.jQuery": "jquery" + "window.jQuery": "jquery", + "window.Materialize": "materialize-css", + "Materialize": "materialize-css" }), new webpack.ContextReplacementPlugin( /angular(\\|\/)core(\\|\/)@angular/,