Compare commits
3 Commits
renovate/w
...
windows-bu
Author | SHA1 | Date | |
---|---|---|---|
1ace858bfe | |||
0388bde540 | |||
26fb713560 |
@ -17,6 +17,8 @@ const CrittersPlugin = require('critters-webpack-plugin');
|
||||
const AssetTemplatePlugin = require('./config/asset-template-plugin');
|
||||
const addCssTypes = require('./config/add-css-types');
|
||||
|
||||
const regexpPathSep = path.sep === '\\' ? '\\\\' : '/';
|
||||
|
||||
function readJson (filename) {
|
||||
return JSON.parse(fs.readFileSync(filename));
|
||||
}
|
||||
@ -38,7 +40,7 @@ module.exports = async function (_, env) {
|
||||
return {
|
||||
mode: isProd ? 'production' : 'development',
|
||||
entry: {
|
||||
'first-interaction': './src/index'
|
||||
'first-interaction': path.join('.', 'src', 'index'),
|
||||
},
|
||||
devtool: isProd ? 'source-map' : 'inline-source-map',
|
||||
stats: 'minimal',
|
||||
@ -52,13 +54,13 @@ module.exports = async function (_, env) {
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.mjs', '.js', '.scss', '.css'],
|
||||
alias: {
|
||||
style: path.join(__dirname, 'src/style')
|
||||
style: path.join(__dirname, 'src', 'style')
|
||||
}
|
||||
},
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
// async-component-loader returns a wrapper component that waits for the import to load before rendering:
|
||||
async: path.join(__dirname, 'config/async-component-loader')
|
||||
async: path.join(__dirname, 'config', 'async-component-loader')
|
||||
}
|
||||
},
|
||||
module: {
|
||||
@ -147,11 +149,11 @@ module.exports = async function (_, env) {
|
||||
},
|
||||
{
|
||||
// All the codec files define a global with the same name as their file name. `exports-loader` attaches those to `module.exports`.
|
||||
test: /\/codecs\/.*\.js$/,
|
||||
test: new RegExp(`${regexpPathSep}codecs${regexpPathSep}.*\.js`),
|
||||
loader: 'exports-loader'
|
||||
},
|
||||
{
|
||||
test: /\/codecs\/.*\.wasm$/,
|
||||
test: new RegExp(`${regexpPathSep}codecs${regexpPathSep}.*\.wasm`),
|
||||
// This is needed to make webpack NOT process wasm files.
|
||||
// See https://github.com/webpack/webpack/issues/6725
|
||||
type: 'javascript/auto',
|
||||
@ -172,7 +174,7 @@ module.exports = async function (_, env) {
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin(
|
||||
/(fs|crypto|path)/,
|
||||
new RegExp(`${path.sep}codecs${path.sep}`)
|
||||
new RegExp(`${regexpPathSep}codecs${regexpPathSep}`)
|
||||
),
|
||||
|
||||
// Pretty progressbar showing build progress:
|
||||
|
Reference in New Issue
Block a user