Skip to content

Commit

Permalink
Update development environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
satorumurmur committed Nov 5, 2019
1 parent 831c0ae commit 321008b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions webpack.config.js
Expand Up @@ -143,7 +143,17 @@ module.exports = (env, argv) => {
if(Bibi.KeepBackCompat) Config.plugins.push(new CopyPlugin([
'bib/**'
].map(N => ({ from: N, to: Bibi.DIST })), { context: './' + Bibi.SRCBC }));
if(Config.mode === 'production') {
if(IsDev) {
Config.module.rules.push({
test: /\/bibi\.heart\.js$/,
use: [
StringReplacePlugin.replace({ replacements: [{
pattern: /$/,
replacement: () => '\n' + `Bibi.Dev = true;`
}]})
]
});
} else {
Config.optimization.minimizer.push(new TerserPlugin({
cache: true,
parallel: true,
Expand All @@ -162,17 +172,6 @@ module.exports = (env, argv) => {
{ from: 'LICENSE', to: './' + Bibi.DIST + '/bibi' },
{ from: 'README.md', to: './' + Bibi.DIST + '/bibi' }
]));
} else if(Config.mode === 'development') {
Config.module.rules.push({
test: /\/bibi\.heart\.js$/,
use: [
StringReplacePlugin.replace({ replacements: [{
pattern: /$/,
replacement: () => '\n' + `Bibi.Dev = true;`
}]})
]
});
} else {
}
return Config;
};

0 comments on commit 321008b

Please sign in to comment.