dynamic-expressions-ignore-plugins

// if you path import('./app/${moduleName}/index') webpack can rematch all /./app/.+/index.js/ // but use dev you only load user module, you can use this package new DynamicExpressionsIgnore({ variableName: 'moduleName', replacePath: ./app/user/index }) // or use env

Usage no npm install needed!

<script type="module">
  import dynamicExpressionsIgnorePlugins from 'https://cdn.skypack.dev/dynamic-expressions-ignore-plugins';
</script>

README

use age


// if you path    import('./app/${moduleName}/index')  webpack can rematch all /\.\/app\/.+\/index\.js/ 
// but use dev you only load user module, you can use this package
new DynamicExpressionsIgnore({
    variableName: 'moduleName',
    replacePath: `./app/user/index`
})
// or use env

// cross-env APPNAME=user
new DynamicExpressionsIgnore({
    variableName: 'moduleName',
    replacePath: `./app/${process.env.APPNAME}`
})