The smart merge feature has been dropped from the webpack-merge library that we were using. Use the basic merge feature instead since we're not actually doing anything too complicated. Also don't return null from the WorkerConfig as it can't be correctly merged.
67 lines
2.2 KiB
JavaScript
67 lines
2.2 KiB
JavaScript
/* eslint-env node */
|
|
|
|
'use strict';
|
|
|
|
var Merge = require('webpack-merge');
|
|
var path = require('path');
|
|
var webpack = require('webpack');
|
|
var _ = require('underscore');
|
|
|
|
var commonConfig = require('./webpack.common.config.js');
|
|
|
|
module.exports = _.values(Merge.merge(commonConfig, {
|
|
web: {
|
|
output: {
|
|
filename: '[name].js'
|
|
},
|
|
devtool: 'source-map',
|
|
plugins: [
|
|
new webpack.LoaderOptionsPlugin({
|
|
debug: true
|
|
}),
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
'process.env.JS_ENV_EXTRA_CONFIG': process.env.JS_ENV_EXTRA_CONFIG || '{}',
|
|
'CAPTIONS_CONTENT_TO_REPLACE': JSON.stringify(process.env.CAPTIONS_CONTENT_TO_REPLACE || ''),
|
|
'CAPTIONS_CONTENT_REPLACEMENT': JSON.stringify(process.env.CAPTIONS_CONTENT_REPLACEMENT || '')
|
|
})
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /.scss$/,
|
|
include: [
|
|
/paragon/,
|
|
/font-awesome/
|
|
],
|
|
use: [
|
|
'style-loader',
|
|
{
|
|
loader: 'css-loader',
|
|
options: {
|
|
sourceMap: true,
|
|
modules: true,
|
|
localIdentName: '[name]__[local]'
|
|
}
|
|
},
|
|
{
|
|
loader: 'sass-loader',
|
|
options: {
|
|
data: '$base-rem-size: 0.625; @import "paragon-reset";',
|
|
includePaths: [
|
|
path.join(__dirname, './node_modules/@edx/paragon/src/utils'),
|
|
path.join(__dirname, './node_modules/')
|
|
],
|
|
sourceMap: true
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
watchOptions: {
|
|
ignored: ['/node_modules/', '/\.git/']
|
|
}
|
|
}
|
|
}));
|