Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
entry: {
'demo/index' : './src/demo/index.js',
index: './src/main.js',
'lib/ce-modal-window/index': './src/components/ce-modal-window/index.js'
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'TDD Challenge',
meta: {
viewport: 'width=device-width, initial-scale=1'
}
})
],
module: {
rules: [
// use the html loader
{
test: /\.html$/,
exclude: /node_modules/,
use: {loader: 'html-loader'}
},
// use the css loaders (first load the css, then inject the style)
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(png|gif|jpg|jpeg|svg|xml|json)$/,
use: [ 'url-loader' ]
}
]
},
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10
},
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.