Last active
October 22, 2018 08:53
-
-
Save YonatanKra/eb532d711cc1c88e80e7918c49216b18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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