You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
No name was provided for external module '@angular/core' in options.globals - guessing 'core'
No name was provided for external module '@angular/common' in options.globals - guessing 'common'
No name was provided for external module '@angular/router' in options.globals -guessing 'router'
No name was provided for external module 'rxjs/Observable' in options.globals -guessing 'Observable'
No name was provided for external module 'rxjs/Subject' in options.globals - guessing 'Subject'
No name was provided for external module '@angular/platform-browser' in options.globals - guessing 'platformBrowser'
No name was provided for external module '@angular/forms' in options.globals - guessing 'forms'
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:
gulp.task('rollup:umd', function () {
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: [
'@angular/core',
'@angular/platform-browser',
'@angular/common',
'@angular/forms',
'@angular/router',
'rxjs/Observable',
'rxjs/Subject'
],
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: {
typescript: 'ts'
}
},
}))
.pipe(rename('vueframework.umd.js'))
.pipe(gulp.dest(distFolder));
});
The text was updated successfully, but these errors were encountered:
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(){constrollupGlobals={'@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'}returngulp.src(`${buildFolder}/**/*.js`)// transform the files here..pipe(rollup({// Bundle's entry point// See "input" in https://rollupjs.org/#core-functionalityinput: `${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-functionalityexternal: Object.keys(rollupGlobals),output: {// Format of generated bundle// See "format" in https://rollupjs.org/#core-functionalityformat: 'umd',// Export mode to use// See "exports" in https://rollupjs.org/#danger-zoneexports: 'named',// The name to use for the module for UMD/IIFE bundles// (required for bundles with exports)// See "name" in https://rollupjs.org/#core-functionalityname: 'vueframework',// See "globals" in https://rollupjs.org/#core-functionalityglobals: 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:
});
The text was updated successfully, but these errors were encountered: