-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: A single rollup config, and let karma rollup during run (#155)
- Loading branch information
1 parent
6664523
commit d3c6ba1
Showing
16 changed files
with
1,452 additions
and
241 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
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
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 |
---|---|---|
|
@@ -28,4 +28,3 @@ node_modules/ | |
# Build-related directories | ||
dist/ | ||
docs/api/ | ||
test/dist/ |
This file was deleted.
Oops, something went wrong.
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
47 changes: 0 additions & 47 deletions
47
generators/app/templates/scripts/_modules.rollup.config.js
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
generators/app/templates/scripts/_primed-rollup-plugins.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const babel = require('rollup-plugin-babel'); | ||
const commonjs = require('rollup-plugin-commonjs'); | ||
const json = require('rollup-plugin-json'); | ||
const multiEntry = require('rollup-plugin-multi-entry'); | ||
const resolve = require('rollup-plugin-node-resolve'); | ||
const {uglify} = require('rollup-plugin-uglify'); | ||
const {minify} = require('uglify-es'); | ||
|
||
module.exports = { | ||
babel: babel({ | ||
babelrc: false, | ||
exclude: 'node_modules/**', | ||
presets: [ | ||
['es2015', {loose: true, modules: false}] | ||
], | ||
plugins: [ | ||
'external-helpers', | ||
'transform-object-assign' | ||
] | ||
}), | ||
commonjs: commonjs({sourceMap: false}), | ||
json: json(), | ||
multiEntry: multiEntry({exports: false}), | ||
resolve: resolve({browser: true, main: true, jsnext: true}), | ||
uglify: uglify({output: {comments: 'some'}}, minify) | ||
}; |
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,62 @@ | ||
/** | ||
* Rollup configuration for packaging the plugin in various formats. | ||
*/ | ||
const plugins = require('./primed-rollup-plugins.js'); | ||
const banner = require('./banner.js').comment; | ||
|
||
|
||
|
||
// to prevent a screen during rollup watch | ||
process.stderr.isTTY = false; | ||
|
||
const umdGlobals = { | ||
'video.js': 'videojs', | ||
'global': 'window', | ||
'global/window': 'window', | ||
'global/document': 'document' | ||
}; | ||
const moduleGlobals = { | ||
'video.js': 'videojs' | ||
}; | ||
|
||
export default [{ | ||
// umd | ||
input: 'src/plugin.js', | ||
output: { | ||
name: '<%= moduleName %>', | ||
file: 'dist/<%= pluginName %>.js', | ||
format: 'umd', | ||
globals: umdGlobals, | ||
banner | ||
}, | ||
external: Object.keys(umdGlobals), | ||
plugins: [plugins.resolve, plugins.json, plugins.commonjs, plugins.babel] | ||
}, { | ||
// minified umd | ||
input: 'src/plugin.js', | ||
output: { | ||
name: '<%= moduleName %>', | ||
file: 'dist/<%= pluginName %>.min.js', | ||
format: 'umd', | ||
globals: umdGlobals, | ||
banner | ||
}, | ||
external: Object.keys(umdGlobals), | ||
plugins: [ | ||
plugins.resolve, | ||
plugins.json, | ||
plugins.commonjs, | ||
plugins.uglify, | ||
plugins.babel | ||
] | ||
}, { | ||
// cjs and es | ||
input: 'src/plugin.js', | ||
output: [ | ||
{file: 'dist/<%= pluginName %>.cjs.js', format: 'cjs', globals: moduleGlobals, banner}, | ||
{file: 'dist/<%= pluginName %>.es.js', format: 'es', globals: moduleGlobals, banner} | ||
], | ||
external: Object.keys(moduleGlobals) | ||
.concat(['global', 'global/window', 'global/document']), | ||
plugins: [plugins.json, plugins.babel] | ||
}]; |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.