Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Last active October 22, 2018 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/eb532d711cc1c88e80e7918c49216b18 to your computer and use it in GitHub Desktop.
Save YonatanKra/eb532d711cc1c88e80e7918c49216b18 to your computer and use it in GitHub Desktop.
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