完成ci优化

This commit is contained in:
Harvey Zack committed 2018-11-30 17:25:48 +08:00
1 parent 848c6ab131
commit 00ea9c4ca4
23 files changed
+94 -306

No files matched your search

@@ -1,11 +0,0 @@
{
"presets": [
[
"@babel/env",
{
"modules": false
}
]
],
"plugins": ["@babel/plugin-external-helpers", "@babel/plugin-transform-runtime"]
}
@@ -4,6 +4,9 @@
"description": "Danmu plugin for ArtPlayer",
"main": "dist/artplayer-plugin-subtitle.js",
"style": "dist/artplayer-plugin-subtitle.css",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/zhw2590582/ArtPlayer.git"
@@ -1,63 +0,0 @@
const path = require('path');
const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
const postcss = require('rollup-plugin-postcss');
const { eslint } = require('rollup-plugin-eslint');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const replace = require('rollup-plugin-replace');
const svgo = require('rollup-plugin-svgo');
const { uglify } = require('rollup-plugin-uglify');
const { version, homepage, name } = require('./package.json');
const isProd = process.env.NODE_ENV === 'production';
const banner =
'/*!\n' +
` * ${name}.js v${version}\n` +
` * Github: ${homepage}\n` +
` * (c) 2017-${new Date().getFullYear()} Harvey Zack\n` +
' * Released under the MIT License.\n' +
' */\n';
export default {
input: 'src/index.js',
output: {
name,
file: isProd ? `dist/${name}.js` : path.join(process.cwd(), '../../', `docs/uncompiled/${name}.js`),
format: 'umd',
exports: 'named',
},
plugins: [
eslint({
exclude: ['node_modules/**', 'src/**/*.scss', 'src/**/*.svg'],
}),
postcss({
plugins: [autoprefixer, cssnano],
extract: isProd ? `dist/${name}.css` : path.join(process.cwd(), '../../', `docs/uncompiled/${name}.css`),
}),
nodeResolve(),
commonjs(),
babel({
runtimeHelpers: true,
exclude: 'node_modules/**',
presets: [['@babel/env', { modules: false }]],
plugins: ['@babel/plugin-external-helpers', '@babel/plugin-transform-runtime'],
}),
svgo({
raw: true,
}),
replace({
exclude: 'node_modules/**',
__ENV__: JSON.stringify(process.env.NODE_ENV || 'development'),
__VERSION__: version,
}),
isProd &&
uglify({
output: {
preamble: banner,
},
}),
],
};