2020-03-28 00:35:00 +00:00
|
|
|
const { join } = require('path');
|
2020-03-27 20:59:38 +00:00
|
|
|
const { env } = require('process');
|
|
|
|
|
2020-10-08 14:43:00 +00:00
|
|
|
const settings = {
|
|
|
|
source_path: 'app',
|
|
|
|
public_root_path: 'static',
|
|
|
|
public_output_path: getPublicOutputPath(),
|
|
|
|
cache_path: 'tmp/cache/webpacker',
|
|
|
|
resolved_paths: [],
|
|
|
|
static_assets_extensions: [ '.jpg', '.jpeg', '.png', '.tiff', '.ico', '.svg', '.gif', '.eot', '.otf', '.ttf', '.woff', '.woff2' ],
|
|
|
|
extensions: [ '.mjs', '.js', '.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css', '.png', '.svg', '.gif', '.jpeg', '.jpg' ],
|
|
|
|
};
|
2020-03-27 20:59:38 +00:00
|
|
|
|
2020-10-08 14:43:00 +00:00
|
|
|
function getPublicOutputPath() {
|
|
|
|
if (env.NODE_ENV === 'test') {
|
|
|
|
return 'packs-test';
|
|
|
|
}
|
|
|
|
|
|
|
|
return 'packs';
|
|
|
|
}
|
|
|
|
|
2021-07-21 21:13:24 +00:00
|
|
|
function packsPath(path) {
|
|
|
|
return join(settings.public_output_path, path);
|
2020-03-27 20:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
settings,
|
|
|
|
env: {
|
|
|
|
NODE_ENV: env.NODE_ENV,
|
|
|
|
},
|
2021-07-21 21:13:24 +00:00
|
|
|
packsPath,
|
2020-03-27 20:59:38 +00:00
|
|
|
};
|