Closed nirving closed 6 years ago
If i do the following
npm install rollup-plugin-commonjs
add the following to the var
commonjs = require('rollup-plugin-commonjs');
and add
plugins: [
commonjs()
],
to rollup:fesm
and rollup:umd
it returns
[19:37:35] Starting 'clean:dist'...
[19:37:35] Finished 'clean:dist' after 18 ms
[19:37:35] Starting 'clean:tmp'...
[19:37:35] Finished 'clean:tmp' after 147 μs
[19:37:35] Starting 'clean:build'...
[19:37:35] Finished 'clean:build' after 308 μs
[19:37:35] Starting 'clean'...
[19:37:35] Finished 'clean' after 21 μs
[19:37:35] Starting 'compile'...
[19:37:35] Starting 'clean:dist'...
[19:37:35] Finished 'clean:dist' after 155 μs
[19:37:35] Starting 'copy:source'...
[19:37:35] Finished 'compile' after 12 ms
[19:37:35] Starting 'build'...
[19:37:35] Finished 'build' after 4.53 μs
[19:37:35] Finished 'copy:source' after 138 ms
[19:37:35] Starting 'inline-resources'...
[19:37:35] Finished 'inline-resources' after 41 ms
[19:37:35] Starting 'ngc'...
[19:37:38] Finished 'ngc' after 2.68 s
[19:37:38] Starting 'rollup:fesm'...
The following options have been renamed — please update your config: sourceMap -> output.sourcemap, format -> output.format
'buffer' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_readable.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_readable.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules\inherits\inherits.js, but could not be resolved – treating it as an external dependency
'util' is imported by commonjs-external:util, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_readable.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_writable.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules\util-deprecate\node.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_writable.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by commonjs-external:buffer, but could not be resolved – treating it as an external dependency
'events' is imported by commonjs-external:events, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules\jszip\node_modules\string_decoder\index.js, but could not be resolved – treating it as an external dependency
'LOCALE_ID', 'APP_ID', 'ApplicationInitStatus', 'ApplicationModule', 'ErrorHandler', 'RendererFactory2', 'Sanitizer' and 'Testability' are imported from external module '@angular/core' but never used
'FormGroup' is imported from external module '@angular/forms' but never used
[19:37:46] Finished 'rollup:fesm' after 8.38 s
[19:37:46] Starting 'rollup:umd'...
The following options have been renamed — please update your config: name -> output.name, globals -> output.globals, format -> output.format, exports -> output.exports
'buffer' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_readable.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_readable.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules\inherits\inherits.js, but could not be resolved – treating it as an external dependency
'util' is imported by commonjs-external:util, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_readable.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_writable.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules\util-deprecate\node.js, but could not be resolved – treating it as an external dependency
'events' is imported by node_modules\jszip\node_modules\readable-stream\lib\_stream_writable.js, but could not be resolved – treating it as an external dependency
'buffer' is imported by commonjs-external:buffer, but could not be resolved – treating it as an external dependency
'events' is imported by commonjs-external:events, but could not be resolved – treating it as an external dependency
'buffer' is imported by node_modules\jszip\node_modules\string_decoder\index.js, but could not be resolved – treating it as an external dependency
'LOCALE_ID', 'APP_ID', 'ApplicationInitStatus', 'ApplicationModule', 'ErrorHandler', 'RendererFactory2', 'Sanitizer' and 'Testability' are imported from external module '@angular/core' but never used
'FormGroup' is imported from external module '@angular/forms' but never used
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/forms' in options.globals – guessing 'forms'
No name was provided for external module 'buffer' in options.globals – guessing 'require$$0'
No name was provided for external module 'events' in options.globals – guessing 'events'
No name was provided for external module 'util' in options.globals – guessing 'debugUtil'
No name was provided for external module '@angular/animations' in options.globals – guessing 'animations'
[19:37:53] Finished 'rollup:umd' after 7.1 s
[19:37:53] Starting 'copy:build'...
[19:37:53] Finished 'copy:build' after 97 ms
[19:37:53] Starting 'copy:manifest'...
[19:37:53] Finished 'copy:manifest' after 4.6 ms
[19:37:53] Starting 'copy:readme'...
[19:37:53] Finished 'copy:readme' after 4.19 ms
[19:37:53] Starting 'clean:build'...
[19:37:53] Finished 'clean:build' after 27 ms
[19:37:53] Starting 'clean:tmp'...
[19:37:53] Finished 'clean:tmp' after 19 ms
Compilation finished succesfully
will test and see if it works.
Hi @nirving can you please share the source code of events.js
?
@izifortune — Thank you for your follow-up, much appreciated! 🏆
So what is the final solution for this problem?
For those stumbling across this one. After spending way too long on the problem I realised it was an issue with the export. I had:
export * from './directory';
changed it to:
export * from './directory/index';
and the gulp tasks completed.
@gary-holland — Thank you for the update, much appreciated!
When running
npm run build
I am getting the followingIt would seem it only likes flat file structures and not those build with directories.
In my
src
directory I haveand in
src\directives
Do I need the
rollup-plugin-commonjs
orrollup-plugin-node-resolve
to resolve this? Any ideas?Thanks Nicholas Irving