New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not support for Rollup in AOT mode #85
Comments
well, i have gotten a new way to resolve this problem, the is the plugins section in my rollup-config:
if not add in commonjs, there will be a new undefined-error throwed in runtime. |
angular cli is officially supported, rollup has not been tested yet. |
Sounds valid, the current usage is not valid JavaScript code and has been banned in TypeScript (microsoft/TypeScript#2242 (comment)) for a long time, I'm not sure why it could still compile. |
Updatedcorrectly default import support by rollup, but not import * as moment from moment. Useimport moment from 'moment'; Updated Againno better way to use moment. There is a consensus that use |
@LinboLen There is no definition of how ES module interacts with CommonJS, for native Node.js and earlier version of Babel (by default), the Moreover, TypeScript has provided Frankly, there is no valid way to import something like |
long time i have not tracking ecmascript import feature. onething i can confirm. should only use i know node style, but right now should only use i know moment, really heart me ever.(i use ref |
the problem is there are functions and namespace in this library with the same declare name 'moment', and the rollup can not the difference.
in fact, the 'moment' to be used is a function ,not a namespace... but it seems that rollup don't know it |
Whatever import by as must be a namespace, that's the semantics of JavaScript language, and CommonJS |
but we need a solution here, or the experience in AOT and rollup won't be improved. |
my opinion is whether a hack or reconstruction in source code of ng-zorro isfeasible, but not the most important. thst's my hack way ,though it' not elegant, and i prefer an official solution if possible. |
The best way to do is to make |
Even i tried pass through the rollup compiling with success, the generated build.js file executed with errors that can't resolve. We recommend using angular-cli's tree-shaking functionality because these functions update too quickly. |
Will be solved by #240. |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
I'm submitting a...
Current behavior
When i try to rollup for the AOT mode, i find that it's impossible to build with ng-zorro.
the error message is below here:
Expected behavior
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
the problem is the 'moment', it's imported in time-picker component in this format:
but it's not support in AOT mode.
if i change the format into
,no errors will be called up, but still some other errors in moment.
if i remove the NG-ZORRO from my angular4 project, there is nothing wrong.
And there is no problems in JIT mode.
I don't think change the source by myself is a good way to resolve this problem.
I need help.
Environment
The text was updated successfully, but these errors were encountered: