namesny-com/webpack.prod.config.js

58 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-07-15 14:52:09 +00:00
const { resolve, join } = require('path')
const webpack = require('webpack')
const config = {
2018-05-10 08:48:39 +00:00
mode: 'production',
2017-07-15 14:52:09 +00:00
context: resolve(__dirname, 'src'),
entry: {
bundle: [
'./app-client.js'
]
},
output: {
path: resolve(__dirname, 'public/static'),
filename: '[name].js',
publicPath: '/static/'
},
module: {
rules: [
{
test: /\.js$/,
use: [
'babel-loader'
],
exclude: '/node_modules/'
},
{
2018-05-04 17:34:25 +00:00
test: /\.scss$/,
2017-07-15 14:58:05 +00:00
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
2018-05-10 08:48:39 +00:00
importLoaders: 2,
2017-07-15 14:58:05 +00:00
localIdentName: '[name]__[local]___[hash:base64:5]'
2017-07-15 14:52:09 +00:00
}
2017-07-15 14:58:05 +00:00
},
2018-05-09 13:33:32 +00:00
{
loader: "postcss-loader"
},
{
loader: 'sass-loader'
}
2017-07-15 14:58:05 +00:00
]
},
{
test: /\.(png|jpg)$/,
exclude: /node_modules/,
loader: 'url-loader'
},
2017-07-15 14:52:09 +00:00
]
},
plugins: [
]
}
module.exports = config