2018-11-23 10:41:50 -08:00
|
|
|
const HtmlWebPackPlugin = require('html-webpack-plugin'); // eslint-disable-line
|
|
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); // eslint-disable-line
|
|
|
|
const autoprefixer = require('autoprefixer');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
index: './app/index.js',
|
|
|
|
},
|
|
|
|
optimization: {
|
2018-12-03 11:27:56 -08:00
|
|
|
minimizer: [new UglifyJSPlugin({ sourceMap: true })],
|
2018-11-23 10:41:50 -08:00
|
|
|
},
|
|
|
|
devtool: 'cheap-module-source-map',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
2018-12-03 11:27:56 -08:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'style-loader',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
2018-11-23 10:41:50 -08:00
|
|
|
},
|
2018-12-03 11:27:56 -08:00
|
|
|
{
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
ident: 'postcss',
|
|
|
|
options: {
|
|
|
|
plugins: () => [
|
|
|
|
autoprefixer({
|
|
|
|
browsers: ['> 1%', 'not ie 11'],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
loader: 'sass-loader',
|
|
|
|
},
|
|
|
|
],
|
2018-11-23 10:41:50 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpe?g|gif|svg)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: '[name].[ext]',
|
|
|
|
outputPath: 'assets/',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
|
2018-12-03 11:27:56 -08:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
|
|
|
name: '[name].[ext]',
|
|
|
|
outputPath: 'assets/fonts/',
|
|
|
|
},
|
2018-11-23 10:41:50 -08:00
|
|
|
},
|
2018-12-03 11:27:56 -08:00
|
|
|
],
|
2018-11-23 10:41:50 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebPackPlugin({
|
|
|
|
template: './public/index.html',
|
|
|
|
filename: './index.html',
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
};
|