Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = (env = {}) => {
const config = getWebpackConfig(env);
config.module.rules.push({
// Load worker tests
test: /\.worker\.js$/,
use: {
loader: 'worker-loader'
}
});
// Uncomment to debug config
// console.error(JSON.stringify(config, null, 2));
return [
config,
// For worker tests
// Output bundles to root and can be loaded with `new Worker('/*.worker.js')`
module.exports = env => {
const config = getWebpackConfig(env);
config.module.rules.push({
// This is required to handle inline worker!
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: BABEL_CONFIG
}
]
});
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
__MAPBOX_TOKEN__: JSON.stringify(process.env.MapboxAccessToken) // eslint-disable-line
module.exports = env => {
const config = getWebpackConfig(env);
// Unfortunately, ocular-dev-tool swallows logs...
require('fs').writeFileSync('/tmp/ocular.log', JSON.stringify(config, null, 2));
return config;
};
module.exports = env => getWebpackConfig(env);
module.exports = (env = {}) => {
const config = getWebpackConfig(env);
switch (env.mode) {
case 'size':
config.entry = fs.readdirSync('./test/size').reduce((entries, filename) => {
entries[filename.replace('.js', '')] = `./test/size/${filename}`;
return entries;
}, {});
break;
default:
}
return config;
};