Skip to content

Commit

Permalink
archetype-react-app: Add babel-polyfill to archetype (#212)
Browse files Browse the repository at this point in the history
* Add babel-polyfill to archetype

* code review
  • Loading branch information
didi0613 authored and jchip committed Feb 25, 2017
1 parent c70630d commit e354bd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const pwaConfig = require("./partial/pwa");
const archetype = require("../archetype");
const Path = archetype.Path;
const AppMode = archetype.AppMode;
const polyfill = archetype.webpack.enableBabelPolyfill;
const context = Path.resolve(AppMode.src.client);

const optionalRequire = require("optional-require")(require);
Expand Down Expand Up @@ -54,7 +55,9 @@ const baseConfig = {
}
})
],
entry: appEntry(),
entry: {
main: polyfill ? ["babel-polyfill", appEntry()] : appEntry()
},
output: {
path: Path.resolve("dist", "js"),
pathinfo: inspectpack, // Enable path information for inspectpack
Expand Down
3 changes: 2 additions & 1 deletion packages/electrode-archetype-react-app/config/archetype.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function loadDev() {
devHostname: process.env.WEBPACK_HOST || "localhost",
devPort: utils.getInt(process.env.WEBPACK_DEV_PORT, 2992),
testPort: utils.getInt(process.env.WEBPACK_TEST_PORT, 3001),
modulesDirectories: []
modulesDirectories: [],
enableBabelPolyfill: true
}, archetypeOptions.webpack),
config: Object.assign({}, {
babel: `${configDir}/babel`,
Expand Down

0 comments on commit e354bd4

Please sign in to comment.