Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Only publish minified es modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
zigomir committed May 13, 2018
1 parent eb9ead6 commit a430a5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
13 changes: 7 additions & 6 deletions nanocal/package.json
@@ -1,23 +1,24 @@
{
"name": "nanocal",
"version": "0.3.0",
"module": "dist/nanocal.min.esm.js",
"version": "0.3.1",
"module": "dist/nanocal.min.js",
"main": "dist/nanocal.min.js",
"unpkg": "dist/nanocal.min.js",
"repository": "https://github.com/zigomir/nanocal/tree/master/nanocal",
"license": "MIT",
"homepage": "https://github.com/zigomir/nanocal",
"bugs": "https://github.com/zigomir/nanocal/issues",
"description": "Minimal, AirBnb inspired, date picker",
"scripts": {
"prebuild": "rm -f dist/*",
"build": "../node_modules/.bin/tsc && npm run build:esm && npm run build:esm:min && ../node_modules/.bin/bundlesize",
"build:esm": "../node_modules/.bin/rollup src/main.js -c ../rollup.config.js -f es -o dist/nanocal.esm.js",
"build:esm:min": "../node_modules/.bin/rollup src/main.js -c ../rollup.config.js -f es -o dist/nanocal.min.esm.js",
"build": "../node_modules/.bin/tsc && npm run build:svelte && ../node_modules/.bin/bundlesize",
"build:svelte": "../node_modules/.bin/rollup src/main.js -c ../rollup.config.js -f es -o dist/nanocal.min.js",
"test": "npm run --prefix .. test",
"prepublishOnly": "npm run build && npm run test"
},
"bundlesize": [
{
"path": "dist/nanocal.min.esm.js",
"path": "dist/nanocal.min.js",
"maxSize": "4.5 kB"
}
],
Expand Down
13 changes: 7 additions & 6 deletions ranger/package.json
@@ -1,23 +1,24 @@
{
"name": "nanocal-ranger",
"version": "0.3.0",
"module": "dist/ranger.min.esm.js",
"version": "0.3.1",
"module": "dist/ranger.min.js",
"main": "dist/ranger.min.js",
"unpkg": "dist/ranger.min.js",
"repository": "https://github.com/zigomir/nanocal/tree/master/ranger",
"license": "MIT",
"homepage": "https://github.com/zigomir/nanocal",
"bugs": "https://github.com/zigomir/nanocal/issues",
"description": "Minimal, AirBnb inspired, range picker",
"scripts": {
"prebuild": "rm -f dist/*",
"build": "../node_modules/.bin/tsc && npm run build:esm && npm run build:esm:min && ../node_modules/.bin/bundlesize",
"build:esm": "../node_modules/.bin/rollup src/main.js -c ../rollup.config.js -f es -o dist/ranger.esm.js",
"build:esm:min": "../node_modules/.bin/rollup src/main.js -c ../rollup.config.js -f es -o dist/ranger.min.esm.js",
"build": "../node_modules/.bin/tsc && npm run build:svelte && ../node_modules/.bin/bundlesize",
"build:svelte": "../node_modules/.bin/rollup src/main.js -c ../rollup.config.js -f es -o dist/ranger.min.js",
"test": "npm run --prefix .. test",
"prepublishOnly": "npm run build && npm run test"
},
"bundlesize": [
{
"path": "dist/ranger.min.esm.js",
"path": "dist/ranger.min.js",
"maxSize": "5.5 kB"
}
],
Expand Down
3 changes: 1 addition & 2 deletions rollup.config.js
Expand Up @@ -5,7 +5,6 @@ import minify from 'rollup-plugin-babel-minify'
const production = !process.env.ROLLUP_WATCH
const outputIndex = production ? 8 : 9 // TODO: make this more robust
const ranger = process.argv[outputIndex].includes('ranger')
const min = process.argv[outputIndex].includes('.min')
const name = ranger ? 'Ranger' : 'Nanocal'
const cssName = ranger ? 'ranger' : 'nanocal'

Expand All @@ -20,6 +19,6 @@ export default {
dev: !production, // enable run-time checks when not in production
css: css => { css.write(`${production ? 'dist' : 'build'}/${cssName}.min.css`) }
}),
production && min && minify({ comments: false })
production && minify({ comments: false })
]
}

0 comments on commit a430a5a

Please sign in to comment.