Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
449 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sw.js | ||
play.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,5 @@ module.exports = { | |
Tether: true, | ||
Promise: true, | ||
Vue: true | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ workbox*.js* | |
.vscode | ||
coverage | ||
es | ||
docs/static/sw.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,47 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const vue = require("rollup-plugin-vue"); | ||
const babel = require("rollup-plugin-babel"); | ||
const resolve = require("rollup-plugin-node-resolve"); | ||
const commonjs = require("rollup-plugin-commonjs"); | ||
const CleanCSS = require("clean-css"); | ||
const { camelCase } = require("lodash"); | ||
const { name, dependencies } = require("../package.json"); | ||
const fs = require('fs') | ||
const path = require('path') | ||
const vue = require('rollup-plugin-vue') | ||
const babel = require('rollup-plugin-babel') | ||
const resolve = require('rollup-plugin-node-resolve') | ||
const commonjs = require('rollup-plugin-commonjs') | ||
const CleanCSS = require('clean-css') | ||
const { name, dependencies } = require('../package.json') | ||
|
||
const base = path.resolve(__dirname, ".."); | ||
const src = path.resolve(base, "src"); | ||
const dist = path.resolve(base, "dist"); | ||
const base = path.resolve(__dirname, '..') | ||
const src = path.resolve(base, 'src') | ||
const dist = path.resolve(base, 'dist') | ||
|
||
// Ensure dist directory exists | ||
if (!fs.existsSync(dist)) { | ||
fs.mkdirSync(dist); | ||
fs.mkdirSync(dist) | ||
} | ||
|
||
module.exports = { | ||
input: path.resolve(src, "index.js"), | ||
external: Object.keys(dependencies), | ||
name, | ||
plugins: [ | ||
vue({ | ||
cssModules: { | ||
generateScopedName: "[name]__[local]" | ||
}, | ||
css(style) { | ||
fs.writeFileSync(path.resolve(dist, `${name}.css`), new CleanCSS().minify(style).styles); | ||
} | ||
}), | ||
resolve({ external: ["vue"] }), | ||
commonjs(), | ||
babel({ | ||
plugins: [ | ||
'external-helpers' | ||
] | ||
}) | ||
], | ||
output: [ | ||
{ | ||
format: "es", | ||
file: path.resolve(dist, name + ".esm.js"), | ||
sourcemap: true | ||
} | ||
] | ||
}; | ||
input: path.resolve(src, 'index.js'), | ||
external: Object.keys(dependencies), | ||
name, | ||
plugins: [ | ||
vue({ | ||
cssModules: { | ||
generateScopedName: '[name]__[local]' | ||
}, | ||
css (style) { | ||
fs.writeFileSync(path.resolve(dist, `${name}.css`), new CleanCSS().minify(style).styles) | ||
} | ||
}), | ||
resolve({ external: ['vue'] }), | ||
commonjs(), | ||
babel({ | ||
plugins: [ | ||
'external-helpers' | ||
] | ||
}) | ||
], | ||
output: [ | ||
{ | ||
format: 'es', | ||
file: path.resolve(dist, name + '.esm.js'), | ||
sourcemap: true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,63 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const vue = require("rollup-plugin-vue"); | ||
const babel = require("rollup-plugin-babel"); | ||
const resolve = require("rollup-plugin-node-resolve"); | ||
const commonjs = require("rollup-plugin-commonjs"); | ||
const CleanCSS = require("clean-css"); | ||
const { camelCase } = require("lodash"); | ||
const { name, dependencies } = require("../package.json"); | ||
const fs = require('fs') | ||
const path = require('path') | ||
const vue = require('rollup-plugin-vue') | ||
const babel = require('rollup-plugin-babel') | ||
const resolve = require('rollup-plugin-node-resolve') | ||
const commonjs = require('rollup-plugin-commonjs') | ||
const CleanCSS = require('clean-css') | ||
const { camelCase } = require('lodash') | ||
const { name, dependencies } = require('../package.json') | ||
|
||
const base = path.resolve(__dirname, ".."); | ||
const src = path.resolve(base, "src"); | ||
const dist = path.resolve(base, "dist"); | ||
const base = path.resolve(__dirname, '..') | ||
const src = path.resolve(base, 'src') | ||
const dist = path.resolve(base, 'dist') | ||
|
||
// Ensure dist directory exists | ||
if (!fs.existsSync(dist)) { | ||
fs.mkdirSync(dist); | ||
fs.mkdirSync(dist) | ||
} | ||
|
||
// Libs in `external` will not be bundled to dist, | ||
// since they are expected to be provided later. | ||
// We want to include some of them in the build, so we exclude it here. | ||
const externalExcludes = [ | ||
'popper.js', | ||
'lodash.startcase' | ||
]; | ||
'popper.js', | ||
'lodash.startcase' | ||
] | ||
|
||
module.exports = { | ||
input: path.resolve(src, "index.js"), | ||
external: Object.keys(dependencies).filter(dep => externalExcludes.indexOf(dep) === -1), | ||
name, | ||
plugins: [ | ||
vue({ | ||
cssModules: { | ||
generateScopedName: "[name]__[local]" | ||
}, | ||
css(style) { | ||
fs.writeFileSync(path.resolve(dist, `${name}.css`), new CleanCSS().minify(style).styles); | ||
} | ||
}), | ||
resolve({ external: ["vue"] }), | ||
commonjs(), | ||
babel({ | ||
plugins: [ | ||
'external-helpers' | ||
] | ||
}) | ||
], | ||
output: [ | ||
{ | ||
format: "cjs", | ||
name: camelCase(name), | ||
file: path.resolve(dist, name + ".common.js"), | ||
sourcemap: true | ||
}, | ||
{ | ||
format: "umd", | ||
modulename: camelCase(name), | ||
file: path.resolve(dist, name + ".js"), | ||
sourcemap: true | ||
} | ||
] | ||
}; | ||
input: path.resolve(src, 'index.js'), | ||
external: Object.keys(dependencies).filter(dep => externalExcludes.indexOf(dep) === -1), | ||
name, | ||
plugins: [ | ||
vue({ | ||
cssModules: { | ||
generateScopedName: '[name]__[local]' | ||
}, | ||
css (style) { | ||
fs.writeFileSync(path.resolve(dist, `${name}.css`), new CleanCSS().minify(style).styles) | ||
} | ||
}), | ||
resolve({ external: ['vue'] }), | ||
commonjs(), | ||
babel({ | ||
plugins: [ | ||
'external-helpers' | ||
] | ||
}) | ||
], | ||
output: [ | ||
{ | ||
format: 'cjs', | ||
name: camelCase(name), | ||
file: path.resolve(dist, name + '.common.js'), | ||
sourcemap: true | ||
}, | ||
{ | ||
format: 'umd', | ||
modulename: camelCase(name), | ||
file: path.resolve(dist, name + '.js'), | ||
sourcemap: true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.