Add materialize in webpack configuration.

This commit is contained in:
Alexis Lahouze 2017-10-15 14:42:41 +02:00
parent 4982931457
commit 1496dca1bc

View File

@ -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/,