2018-11-26 01:51:26 -05:00
|
|
|
const path = require('path')
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
|
|
|
|
module.exports = {
|
2018-11-26 22:24:31 -05:00
|
|
|
entry: [
|
|
|
|
'core-js/fn/array/from',
|
|
|
|
'core-js/fn/array/includes',
|
|
|
|
'./src/app.js'
|
|
|
|
],
|
2018-11-26 01:51:26 -05:00
|
|
|
mode: process.env.NODE_ENV || 'development',
|
|
|
|
output: {
|
|
|
|
filename: '[name].[contenthash].js',
|
|
|
|
path: path.resolve(__dirname, 'dist')
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: 'src/index.html'
|
|
|
|
})
|
|
|
|
],
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.html$/,
|
|
|
|
loader: 'html-loader',
|
|
|
|
options: {
|
|
|
|
interpolate: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(scss)$/,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
// Adds CSS to the DOM by injecting a `<style>` tag
|
|
|
|
loader: 'style-loader'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Interprets `@import` and `url()` like `import/require()` and will resolve them
|
|
|
|
loader: 'css-loader'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Loader for webpack to process CSS with PostCSS
|
|
|
|
loader: 'postcss-loader',
|
|
|
|
options: {
|
|
|
|
plugins: function () {
|
|
|
|
return [
|
|
|
|
require('autoprefixer')
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// Loads a SASS/SCSS file and compiles it to CSS
|
|
|
|
loader: 'sass-loader'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|