diff --git a/react/package.json b/react/package.json index 40756ee3..95c20e78 100644 --- a/react/package.json +++ b/react/package.json @@ -20,10 +20,10 @@ "transpile": "tsc && npm run copy-files", "transpile:dash": "tsc && rimraf ./dist/components/*/**/", "tidy-up": "rimraf ./R && rimraf ./dist && rimraf ./inst && rimraf ./man && rimraf ./.Rbuildignore", - "build:js": "webpack --mode production --entry ./dist/index.js", + "build:js": "webpack --mode production ./dist/index.js", "build:js-dev": "webpack --mode development --entry ./dist/index.js", "build:py_and_r": "npm run transpile:dash && cp -a ../webviz_core_components/. ./webviz_core_components/ && cp ./package.json ./webviz_core_components/package.json && dash-generate-components ./dist/components webviz_core_components -p package.json --r-prefix '' --ignore '(^index.js|.stories.js)$' && cp -a ./webviz_core_components/. ../webviz_core_components/ && rimraf ./webviz_core_components", - "build": "npm run transpile && npm run build:js && npm run build:js-dev && npm run tidy-up && npm run build:py_and_r && npm run tidy-up", + "build": "npm run transpile && npm run build:js && npm run tidy-up && npm run build:py_and_r && npm run tidy-up", "build:npm": "tsc --declaration && npm run copy-files", "copy-files": "copyfiles -u 2 ./src/lib/**/*.svg ./src/lib/**/*.css ./dist/", "prepare": "npm run build:npm", diff --git a/react/webpack.config.js b/react/webpack.config.js index 56e6484f..6369453d 100644 --- a/react/webpack.config.js +++ b/react/webpack.config.js @@ -22,7 +22,10 @@ module.exports = (env, argv) => { // Entry - const entry = argv && argv.entry ? [argv.entry] : [path.join(__dirname, "src/demo/index.tsx")]; + const entry = + argv && argv.entry + ? argv.entry[0] + : path.join(__dirname, "src/demo/index.tsx"); // Output @@ -35,7 +38,8 @@ module.exports = (env, argv) => { // Devtool const devtool = - argv.devtool || (mode === "development" ? "eval-source-map" : false); + argv.devtool || + (mode === "development" ? "eval-source-map" : "source-map"); // Externals