Skip to content

Commit

Permalink
Optimize for production
Browse files Browse the repository at this point in the history
  • Loading branch information
thangngoc89 committed Mar 7, 2018
1 parent 89d7ad5 commit 3a4378c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bsconfig.json
Expand Up @@ -12,7 +12,7 @@
"subdirs" : true
},
"package-specs": [{
"module": "commonjs",
"module": "es6",
"in-source": true
}],
"suffix": ".bs.js",
Expand Down
12 changes: 7 additions & 5 deletions package.json
Expand Up @@ -6,20 +6,22 @@
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "echo \"Error: no test specified\" && exit 1",
"webpack": "webpack -w"
"webpack": "webpack -w",
"webpack:build": "NODE_ENV=production webpack"
},
"keywords": [
"BuckleScript"
],
"author": "",
"license": "MIT",
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"reason-react": ">=0.3.0"
},
"devDependencies": {
"bs-platform": "^2.2.2",
"webpack": "^3.8.1"
"bs-platform": "^2.2.0",

This comment has been minimized.

Copy link
@yawaramin

yawaramin Mar 8, 2018

Hey, I'm wondering why the downgrade?

This comment has been minimized.

Copy link
@thangngoc89

thangngoc89 Mar 8, 2018

Author Owner

My mistake. You can view the pr here rescript-lang/rescript-compiler#2587

"webpack": "^4.0.1",
"webpack-cli": "^2.0.10"
}
}
9 changes: 6 additions & 3 deletions webpack.config.js
@@ -1,11 +1,14 @@
const path = require('path');
const path = require("path");
const outputDir = path.join(__dirname, "build/");

const isProd = process.env.NODE_ENV === "production";

module.exports = {
entry: './src/Index.bs.js',
entry: "./src/Index.bs.js",
mode: isProd ? "production" : "development",
output: {
path: outputDir,
publicPath: outputDir,
filename: 'Index.js',
filename: "Index.js",
},
};

0 comments on commit 3a4378c

Please sign in to comment.