Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 82028a8

Browse files
Merge pull request #23 from basics/feature/rollup
fix(rollup): reconfiguration of rollup process
2 parents 0a4c77e + e6a9849 commit 82028a8

File tree

5 files changed

+138
-14
lines changed

5 files changed

+138
-14
lines changed

.babelrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
"useBuiltIns": "usage"
3636
}
3737
],
38-
"minify"
38+
[
39+
"minify",
40+
{
41+
"builtIns": false
42+
}
43+
]
3944
],
4045
"plugins": [
4146
"istanbul"

.rolluprc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import babel from 'rollup-plugin-babel';
2+
import resolve from 'rollup-plugin-node-resolve';
3+
import minify from 'rollup-plugin-babel-minify';
4+
5+
export default {
6+
input: 'src/index.js',
7+
output: {
8+
name: 'basics',
9+
file: 'lib/bundle.min.js',
10+
format: 'umd',
11+
exports: 'named'
12+
},
13+
14+
plugins: [
15+
resolve(),
16+
babel({
17+
babelrc: false,
18+
exclude: 'node_modules/**',
19+
presets: [['@babel/preset-env', { modules: false }]]
20+
}),
21+
minify({
22+
comments: false,
23+
banner: '/* vector class - MIT License */',
24+
bannerNewLine: true
25+
})
26+
]
27+
};

config.code-workspace

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
".huskyrc": "json",
4242
".postcssrc": "json",
4343
".releaserc": "json",
44+
".rolluprc": "javascript",
4445
".stylelintrc": "json",
4546
".vcmrc": "json",
4647
"*.css": "postcss",

package-lock.json

Lines changed: 99 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:examples": "node examples/",
1616
"cover": "nyc npx mocha --recursive",
1717
"lint": "eslint src",
18-
"build": "cross-env BABEL_ENV=production babel src --out-dir lib",
18+
"build": "cross-env BABEL_ENV=production babel src --out-dir lib && npx rollup --config ./.rolluprc",
1919
"prepare": "npm run clean && npm run test && npm run build",
2020
"semantic-release": "semantic-release"
2121
},
@@ -48,6 +48,7 @@
4848
"babel-eslint": "^10.0.2",
4949
"babel-plugin-istanbul": "^5.2.0",
5050
"babel-preset-minify": "^0.5.0",
51+
"babelrc-rollup": "^3.0.0",
5152
"chai": "^4.2.0",
5253
"cross-env": "^5.2.0",
5354
"eslint": "^6.1.0",
@@ -58,6 +59,9 @@
5859
"husky": "^3.0.2",
5960
"nyc": "^14.1.1",
6061
"rimraf": "^2.6.3",
62+
"rollup-plugin-babel": "^4.3.3",
63+
"rollup-plugin-babel-minify": "^9.0.0",
64+
"rollup-plugin-node-resolve": "^5.2.0",
6165
"semantic-release": "^15.13.19"
6266
},
6367
"dependencies": {

0 commit comments

Comments
 (0)