1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
const { join, resolve } = require('path');
const { env, settings } = require('../configuration');
module.exports = {
test: /\.(js|jsx|mjs)$/,
include: [
settings.source_path,
...settings.resolved_paths,
].map(p => resolve(p)),
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
sourceRoot: 'app/javascript',
cacheDirectory: join(settings.cache_path, 'babel-loader'),
cacheCompression: env.NODE_ENV === 'production',
compact: env.NODE_ENV === 'production',
},
},
],
};
|