Skip to content

Commit d6868b3

Browse files
author
Pooya Parsa
committed
chore: update build scripts
1 parent 81f797b commit d6868b3

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444
},
4545
"files": ["src", "dist", "nuxt", "es"],
4646
"scripts": {
47-
"build": "build/build",
48-
"watch": "rollup -c build/rollup.config.js --watch",
47+
"build": "scripts/build",
48+
"watch": "rollup -c scripts/rollup.config.js --watch",
4949
"docs-dev": "nuxt dev -c docs/nuxt.config.js",
5050
"docs-gen": "nuxt generate -c docs/nuxt.config.js",
5151
"docs-publish":
5252
"gh-pages -t -d docs-dist -b master -r git@github.com:bootstrap-vue/bootstrap-vue.github.io.git",
5353
"test": "yarn lint && NODE_ENV=test jest",
54-
"lint": "eslint src build docs tests nuxt",
55-
"release": "npm run build && npm run test && standard-version",
54+
"lint": "eslint src scripts docs tests nuxt",
55+
"release": "npm run scripts && npm run test && standard-version",
5656
"postinstall": "opencollective postinstall || exit 0"
5757
},
5858
"peerDependencies": {

build/build renamed to scripts/build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ rm -rf dist lib es
88
BABEL_ENV=es babel -d es -D --ignore '*.spec.js,*.json,fixtures' src/
99

1010
# Rollup (dist/)
11-
rollup -c build/rollup.config.js
12-
rollup -c build/rollup.config.esm.js
11+
rollup -c scripts/rollup.config.js
12+
rollup -c scripts/rollup.config.esm.js
1313

1414
# Uglify rollup build
1515
uglify=`pwd`/node_modules/.bin/uglifyjs

build/rollup.config.esm.js renamed to scripts/rollup.config.esm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ if (!fs.existsSync(dist)) {
1919
module.exports = {
2020
input: path.resolve(src, 'index.js'),
2121
external: Object.keys(dependencies),
22-
name,
2322
plugins: [
2423
vue({
2524
cssModules: {
2625
generateScopedName: '[name]__[local]'
2726
},
2827
css (style) {
29-
fs.writeFileSync(path.resolve(dist, `${name}.css`), new CleanCSS().minify(style).styles)
28+
fs.writeFileSync(
29+
path.resolve(dist, `${name}.css`),
30+
new CleanCSS().minify(style).styles
31+
)
3032
}
3133
}),
3234
resolve({ external: ['vue'] }),
3335
commonjs(),
3436
babel({
35-
plugins: [
36-
'external-helpers'
37-
]
37+
plugins: ['external-helpers']
3838
})
3939
],
4040
output: [

build/rollup.config.js renamed to scripts/rollup.config.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,25 @@ const externalExcludes = [
2828

2929
module.exports = {
3030
input: path.resolve(src, 'index.js'),
31-
external: Object.keys(dependencies).filter(dep => externalExcludes.indexOf(dep) === -1),
32-
name,
31+
external: Object.keys(dependencies).filter(
32+
dep => externalExcludes.indexOf(dep) === -1
33+
),
3334
plugins: [
3435
vue({
3536
cssModules: {
3637
generateScopedName: '[name]__[local]'
3738
},
3839
css (style) {
39-
fs.writeFileSync(path.resolve(dist, `${name}.css`), new CleanCSS().minify(style).styles)
40+
fs.writeFileSync(
41+
path.resolve(dist, `${name}.css`),
42+
new CleanCSS().minify(style).styles
43+
)
4044
}
4145
}),
4246
resolve({ external: ['vue'] }),
4347
commonjs(),
4448
babel({
45-
plugins: [
46-
'external-helpers'
47-
]
49+
plugins: ['external-helpers']
4850
})
4951
],
5052
output: [
@@ -56,7 +58,7 @@ module.exports = {
5658
},
5759
{
5860
format: 'umd',
59-
modulename: camelCase(name),
61+
name: camelCase(name),
6062
file: path.resolve(dist, name + '.js'),
6163
sourcemap: true
6264
}

0 commit comments

Comments
 (0)