Skip to content

Commit 2a55df2

Browse files
Using rollup in dedicated folder
1 parent 9917981 commit 2a55df2

File tree

7 files changed

+68
-69
lines changed

7 files changed

+68
-69
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ With :
8686
## Project setup
8787
```bash
8888
$ yarn install
89-
$ yarn build -w
89+
$ yarn build
9090
```
9191

9292
## Open example app

build/rollup.config.base.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import resolve from 'rollup-plugin-node-resolve'
2+
import commonjs from 'rollup-plugin-commonjs'
3+
import vue from 'rollup-plugin-vue'
4+
import babel from 'rollup-plugin-babel'
5+
6+
export default {
7+
input: 'src/main.js',
8+
output: {
9+
name: 'VueScrollProgressBar',
10+
exports: 'named'
11+
},
12+
plugins: [
13+
resolve(),
14+
commonjs(),
15+
vue({
16+
css: true,
17+
compileTemplate: true
18+
}),
19+
babel({
20+
exclude: 'node_modules/**'
21+
})
22+
]
23+
}

build/rollup.config.browser.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import base from './rollup.config.base'
2+
import { terser } from 'rollup-plugin-terser'
3+
import pkg from '../package.json'
4+
5+
const config = Object.assign({}, base, {
6+
output: {
7+
file: pkg.unpkg,
8+
format: 'iife',
9+
...base.output
10+
}
11+
})
12+
13+
config.plugins.push(terser())
14+
15+
export default config

build/rollup.config.es.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import base from './rollup.config.base'
2+
import pkg from '../package.json'
3+
4+
const config = Object.assign({}, base, {
5+
output: {
6+
file: pkg.module,
7+
format: 'es',
8+
...base.output
9+
}
10+
})
11+
12+
export default config

build/rollup.config.umd.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import base from './rollup.config.base'
2+
import pkg from '../package.json'
3+
4+
const config = Object.assign({}, base, {
5+
output: {
6+
file: pkg.main,
7+
format: 'iife',
8+
...base.output
9+
}
10+
})
11+
12+
export default config

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
"module": "dist/vue-scroll-progress-bar.es.js",
88
"unpkg": "dist/vue-scroll-progress-bar.min.js",
99
"scripts": {
10-
"build": "BABEL_ENV=build rollup -c",
10+
"build:browser": "rollup -c build/rollup.config.browser.js",
11+
"build:es": "rollup -c build/rollup.config.es.js",
12+
"build:umd": "rollup -c build/rollup.config.umd.js",
13+
"build": "yarn build:browser && yarn build:es && yarn build:umd",
1114
"prepublishOnly": "yarn build",
12-
"lint": "eslint --ext .js --ignore-path .gitignore src/ --fix"
15+
"lint": "eslint --ext .js --ignore-path .gitignore build/ src/ --fix"
1316
},
1417
"dependencies": {},
1518
"devDependencies": {

rollup.config.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)