2018-08-01 01:01:16 +02:00
|
|
|
const Path = require('path');
|
|
|
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
|
|
|
const createModuleAliases = require('./utils/createModuleAliases.js');
|
|
|
|
const SCSS_ROOT = Path.join(__dirname, 'client/scss/');
|
|
|
|
|
|
|
|
const customAliases = createModuleAliases();
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
target: 'web',
|
2018-09-03 01:48:35 +02:00
|
|
|
entry : ['@babel/polyfill', 'whatwg-fetch', './client/build/index.js'],
|
2018-08-01 01:01:16 +02:00
|
|
|
output: {
|
|
|
|
path : Path.join(__dirname, 'public/bundle'),
|
|
|
|
publicPath: '/bundle/',
|
|
|
|
filename : 'bundle.js',
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
use : ExtractTextPlugin.extract({
|
|
|
|
fallback: 'style-loader',
|
|
|
|
use : ['css-loader', 'sass-loader'],
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png|jpg|gif|otf|ttf|svg)$/,
|
|
|
|
use : [
|
|
|
|
{
|
|
|
|
loader : 'url-loader',
|
|
|
|
options: {
|
|
|
|
limit: 8192,
|
|
|
|
name : '[name]-[hash].[ext]',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
modules: [
|
|
|
|
SCSS_ROOT,
|
|
|
|
'node_modules',
|
|
|
|
__dirname,
|
|
|
|
],
|
|
|
|
alias : customAliases,
|
|
|
|
extensions: ['.js', '.jsx', '.scss'],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new ExtractTextPlugin('style.css'),
|
|
|
|
],
|
|
|
|
};
|