Closed ghaiat closed 8 years ago
I've got this exact same issue here with a webpack 1.13.2 based build :/
I'm using webpack too, and I'm seeing lots of these errors with umd
. Any suggestions on how to fix these?
WARNING in /Users/test/electron-ionic2-webpack-starter/~/ionic-angular/umd/index.js
Critical dependencies:
3:24-31 require function is used in a way in which dependencies cannot be statically extracted
@ /Users/test/electron-ionic2-webpack-starter/~/ionic-angular/umd/index.js 3:24-31
WARNING in /Users/test/electron-ionic2-webpack-starter/~/ionic-angular/umd/module.js
Critical dependencies:
3:24-31 require function is used in a way in which dependencies cannot be statically extracted
@ /Users/test/electron-ionic2-webpack-starter/~/ionic-angular/umd/module.js 3:24-31
WARNING in /Users/test/electron-ionic2-webpack-starter/~/ionic-angular/umd/gestures/drag-gesture.d.ts
Module build failed: Error: Typescript emitted no output for /Users/test/electron-ionic2-webpack-starter/node_modules/ionic-angular/umd/gestures/drag-gesture.d.ts
at Object.loader (/Users/test/electron-ionic2-webpack-starter/node_modules/ts-loader/index.js:456:15)
@ /Users/test/electron-ionic2-webpack-starter/~/ionic-angular/umd/gestures ^\.\/.*$
Upgrading to webpack 2.1.0-beta.25 seems to have fix the problem for me
yeah my assumption was that Webpack 2.x would fix all of this...just didn't wanna have to dive off into slaying that dragon just yet :/
I think we're building our umd
bundles incorrectly. We're learning along with everyone else here. Telling Typescript to create umd
is insufficient it seems.
Thanks, Dan
I managed to fix the umd
issue by adding module
field to resolve.packageMains
of webpack1 configuration:
resolve: {
packageMains: ['module', "webpack", "browser", "web", "browserify", ["jam", "main"], "main"]
},
Hurray! Glad this is working. Let's close it up!
Thanks, Dan
All,
We've posted some docs on the subject. Note: They match a version of @ionic/app-scripts
that will be dropped in the next day or so. 95% of the concepts still apply.
http://ionicframework.com/docs/v2/resources/third-party-libs/ http://ionicframework.com/docs/v2/resources/app-scripts/
Here's an example with AngularFire2. Here is a project I implemented that has every library in it that Ionic users have reported trouble with. Most of the libraries worked, but a couple did not. Here is the summary of the findings.
Please let me know how everything goes.
Thanks, Dan
Same issue here.
After upgrading existing project to
Builds with ts-loader
just stuck an 44%
Builds with awesome-typescript-loader
finishes but output is not full.
I've run same config on non-ionic Angular2 project without any issues.
I would say that Ionic should not be dependent on build system.
@m0n01i7h,
Ionic is dependent on a build system. You're free to build with whatever system you want. Sorry it's not working for you. Keep digging and let us know what's wrong please. We are building umd
via TSC instead of commonjs
so I would expect everything to just work. Unfortunately, we cannot offer technical support and guidance for third party build systems.
Why not use the module
field and bundle our ES2015 tree-shakeable modules instead of the legacy stuff?
Thanks, Dan
So this will remain closed or are we working on a proper webpack implementation?
@msegers,
We have webpack support baked into the build process via the @ionic/app-scripts
package.
Thanks, Dan
Hi everyone, Here is my working app template https://github.com/m0n01i7h/ionic2-webpack-starter Maybe it could be interesting for anyone. I have run it with Webpack 2, ng-compiler-cli and gulp
@m0n01i7h Thanks for sharing I'll look at it intensively, for some reason I just don't get any errors/warnings nor output. Not even with --debug
So I wasn't sure what I"m doing wrong (Still ain't but your example might just help).
It's very strange whenever I use my custom webpack everything seems to break, 0 feedback from app-scripts and an empty page. Your example didn't seem to show anything special as what I"m trying to do. :'(
Hi @msegers
Strange issue. I have run this starter on several computers. Are you trying to run via npm scripts or via webpack cli or via app-scripts?. Try to install webpack2 globally and run webpack
.
@m0n01i7h I'm not running your starter I'm sure it would be fine. I just have this app I've been working on since Alpha that suddenly no longer works now it's in RC ;-). I'm messing with the webpack config now, the only way I can get some output (errors) is by not using a custom webpack config.
Short description of the problem:
I am using webpack as a build process (because we also have web applications and i want use the same process) and since you introduced the umd folder, my build is not working anymore.
What behavior are you expecting?
To be able to build an ionic app with webpack
Steps to reproduce:
Which Ionic Version? 2.0.0.rc-0