From 13d79ae567ca2001c3bebe6547c4c3a21fc1cb59 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Mon, 9 Oct 2017 08:24:11 +0200 Subject: [PATCH] Concat jquery and materialize in separated bundle. --- package.json | 1 + webpack.config.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/package.json b/package.json index 829ee5d..ac6bbcf 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "typescript": "^2.4.2", "url-loader": "^0.6.2", "webpack": "^3.8.1", + "webpack-concat-plugin": "^1.4.1", "webpack-dev-server": "^2.9.3" }, "dependencies": { diff --git a/webpack.config.js b/webpack.config.js index 90e281f..53e6061 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,7 @@ 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'), @@ -114,6 +115,17 @@ 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.ProvidePlugin({ Materialize: "materialize-css", $: "jquery",