Concat jquery and materialize in separated bundle.

This commit is contained in:
Alexis Lahouze 2017-10-09 08:24:11 +02:00
parent a20e481f08
commit 13d79ae567
2 changed files with 13 additions and 0 deletions

View File

@ -43,6 +43,7 @@
"typescript": "^2.4.2", "typescript": "^2.4.2",
"url-loader": "^0.6.2", "url-loader": "^0.6.2",
"webpack": "^3.8.1", "webpack": "^3.8.1",
"webpack-concat-plugin": "^1.4.1",
"webpack-dev-server": "^2.9.3" "webpack-dev-server": "^2.9.3"
}, },
"dependencies": { "dependencies": {

View File

@ -2,6 +2,7 @@
const path = require('path'); const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack'); const webpack = require('webpack');
const ConcatPlugin = require('webpack-concat-plugin');
module.exports = { module.exports = {
context: path.resolve(__dirname, 'src'), context: path.resolve(__dirname, 'src'),
@ -114,6 +115,17 @@ module.exports = {
}] }]
}, },
plugins: [ 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({ new webpack.ProvidePlugin({
Materialize: "materialize-css", Materialize: "materialize-css",
$: "jquery", $: "jquery",