Open sdwallace opened 6 years ago
It might be complaining because you're not giving names to those externals in the output.globals prop. Try this:
gulp.task('rollup:umd', function () {
const rollupGlobals = {
'@angular/core': 'ng.core',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/common': 'ng.common',
'@angular/forms': 'ng.forms',
'@angular/router': 'ng.router',
'rxjs/Observable': 'Rx.Observable',
'rxjs/Subject': 'Rx.Subject',
'typescript': 'ts'
}
return gulp.src(`${buildFolder}/**/*.js`)
// transform the files here.
.pipe(rollup({
// Bundle's entry point
// See "input" in https://rollupjs.org/#core-functionality
input: `${buildFolder}/index.js`,
// Allow mixing of hypothetical and actual files. "Actual" files can be files
// accessed by Rollup or produced by plugins further down the chain.
// This prevents errors like: 'path/file' does not exist in the hypothetical file system
// when subdirectories are used in the `src` directory.
allowRealFiles: true,
// A list of IDs of modules that should remain external to the bundle
// See "external" in https://rollupjs.org/#core-functionality
external: Object.keys(rollupGlobals),
output: {
// Format of generated bundle
// See "format" in https://rollupjs.org/#core-functionality
format: 'umd',
// Export mode to use
// See "exports" in https://rollupjs.org/#danger-zone
exports: 'named',
// The name to use for the module for UMD/IIFE bundles
// (required for bundles with exports)
// See "name" in https://rollupjs.org/#core-functionality
name: 'vueframework',
// See "globals" in https://rollupjs.org/#core-functionality
globals: rollupGlobals
},
}))
.pipe(rename('vueframework.umd.js'))
.pipe(gulp.dest(distFolder));
});
Thanks @caroso1222 but after making that change, I still get the same warnings. I am noticing that the warning says "options.globals" vs "output.globals". Should I still this definition in a different place?
I am getting these 'errors' when I run 'npm run build'. They seem to be warnings as everything works when I use the library but I would like to fix these.
Can anyone give me guidance?
Here is what my complete gulp task looks like. I changed the task a little as rollup was warning me of some config changes:
});