Skip to content

Commit

Permalink
add more dist variants
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalkaoz committed Nov 25, 2017
1 parent d5c398c commit 6e6e441
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
20 changes: 0 additions & 20 deletions .babelrc

This file was deleted.

23 changes: 23 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
"plugins": [],
"presets": [
["@babel/preset-env", {
"modules" : false,
"targets": {
"browsers": ["IE 9"]
}
}]
],
"env": {
"production": {
"plugins" : [
["babel-plugin-transform-remove-console", { "exclude": [ "error", "warn"] }]
]
},
"staging": {
"plugins" : [
["babel-plugin-transform-remove-console", { "exclude": [ "error", "warn"] }]
]
}
}
}
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<link rel="preload" name="Raleway" as="font" type="font/woff2" crossorigin href="font.woff2"/>
<script src="/dist/preload-polyfill.js"></script>
<script src="/dist/preload-polyfill.dev.js"></script>
</head>

<body>
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"dev": "npm run watch",
"watch": "npm run build:polyfill && chokidar-cmd -c \"npm run build:polyfill\" -t src/*.js",
"cs": "prettier --write src/*.js",
"build:polyfill": "rollup -c",
"build": "npm run cs && BABEL_ENV=production npm run build:polyfill"
"build:dev": "rollup -c",
"build:prod": "BABEL_ENV=production rollup -c",
"build:staging" : "BABEL_ENV=staging rollup -c",
"build": "npm run cs && npm run build:dev && npm run build:prod && npm run build:staging"
},
"author": "",
"license": "ISC",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import uglify from "rollup-plugin-uglify";
export default {
input: `src/polyfill.js`,
output: {
file: `dist/preload-polyfill.js`,
file: `dist/preload-polyfill${process.env.BABEL_ENV === 'production' ? '.min' : process.env.BABEL_ENV === 'staging' ? '' : '.dev'}.js`,
format: "iife",
name: `preload_polyfill`
},
Expand Down

0 comments on commit 6e6e441

Please sign in to comment.