Skip to content

Commit

Permalink
chore: prepare migrating to webpack 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Dec 4, 2020
1 parent 497d55e commit 9a549d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test-functional": "mocha -t 60000 --require test/hooks_functional.js --recursive test/functional",
"test-with-coverage": "nyc -n src -r html cross-env npm run test-unit",
"base-test-unit": "cross-env BABEL_DISABLE_CACHE=1 mocha --require @babel/register --file test/unit/bootstrap.js",
"build": "webpack -p",
"build": "cross-env NODE_ENV=production webpack",
"transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib",
"start": "cross-env NODE_ENV=development webpack-dev-server -d --inline --hot",
"debug": "cross-env NODE_ENV=development webpack-dev-server -d --inline --hot --env.noInline=true",
Expand Down
10 changes: 9 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const fs = require('fs');
const path = require('path');

const debugBuild = process.env.NODE_ENV === 'development';
const mode = process.env.NODE_ENV;

const debugBuild = mode === 'development';

/*
configuring babel:
Expand Down Expand Up @@ -45,7 +47,13 @@ module.exports = (env) => {
loader: 'babel-loader',
options: babelConf,
});

return {
mode,
node: {
Buffer: false,
process: false,
},
context: path.resolve(__dirname),
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
Expand Down

0 comments on commit 9a549d4

Please sign in to comment.