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
{{ message }}
This repository was archived by the owner on Dec 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 3, 2023. It is now read-only.
app=angular.module'MyApp', [
# Main deps'ngAnimate'
]
(it will lazy require('angular') automatically)
it will require('ngAnimate'). Specify how to find 'em:
I'm using angular from bower, some shims need be provided.
In config, imports\exports. Angular variable is global also (expose-loader) :
I've been working on a fork of angular-seed to demonstrate how to simply switch from the manual setup most people are familiar with. https://github.com/stackfull/angular-seed
Problem is that angular-webpack-plugin isn't fully working yet. I had to make changes to have aliases properly resolved and that broke the tests (6c7597f).
The reason I want aliases to work is so that if you have modules like "myApp.mod1" "myApp.mod2" and files src/js/amazingapp/mod1.js and src/js/amazingapp/mod2.js, you can alias myApp to src/js/amazingapp and have it all just work
it depends on the author as npm and bower are published separately - you can use the same repo or not, depending on taste.
The reason angular-webpack-plugin doesn't work yet is that the conversion of module names from dots to paths isn't integrated properly with the rest of webpack. So right now, you can use all the features of webpack to find modules (looking for node_modules, using aliases etc.) - and you can use the plugin to recognise angular modules - but if you rely on turning dotted module namespaces into directories, all the other goodies aren't available.
Activity
lmartins commentedon Jul 14, 2014
Really curious about this also, would love to see some examples / use cases for it.
Tks.
ColCh commentedon Jul 25, 2014
Did you tried it?
Getting started:
npm i -D angular-webpack-plugin(it will lazy
require('angular')automatically)require('ngAnimate'). Specify how to find 'em:I'm using angular from bower, some shims need be provided.
In config, imports\exports. Angular variable is global also (expose-loader) :
Now get some aliases for ng-modules from bower_components :
web_modules(resolve.modulesDirectories) and dependencies will berequire'd by plugin and resolved by webpackP.S. manually aliasing of
ngAnimateis bad ... maybe someone advise me how to call deps more abstract?jeffling commentedon Jul 25, 2014
^ you should put in a pull request :)
How about local angular modules? Do you make an alias for all of them?
ColCh commentedon Jul 25, 2014
No, you should place 'em in moduleDir (
web_modulesby default.. or your custom) and they will be revolved by webpack - no manual aliasing needed.Generally, aliasing in bad, and it's my fault :) It's like a hack for #3
stackfull commentedon Jul 25, 2014
I've been working on a fork of angular-seed to demonstrate how to simply switch from the manual setup most people are familiar with. https://github.com/stackfull/angular-seed
Problem is that angular-webpack-plugin isn't fully working yet. I had to make changes to have aliases properly resolved and that broke the tests (6c7597f).
stackfull commentedon Jul 25, 2014
The reason I want aliases to work is so that if you have modules like "myApp.mod1" "myApp.mod2" and files src/js/amazingapp/mod1.js and src/js/amazingapp/mod2.js, you can alias myApp to src/js/amazingapp and have it all just work
jeffling commentedon Jul 25, 2014
@stackfull Yes! That would be really useful :)
Vaguely related question:
Right now, if I have a module,
a.b.cwill it automatically look fora/b/c/index.js?stackfull commentedon Jul 25, 2014
I don't think that will work as of v0.0.1. I was finishing off the resolve too early by looking for files/directories instead of modules.
I hope to make a push at this over the weekend.
ColCh commentedon Jul 25, 2014
What if make installing angular via npm (not bower) required? Or npm packets are clones of bower ones?
stackfull commentedon Jul 25, 2014
it depends on the author as npm and bower are published separately - you can use the same repo or not, depending on taste.
The reason angular-webpack-plugin doesn't work yet is that the conversion of module names from dots to paths isn't integrated properly with the rest of webpack. So right now, you can use all the features of webpack to find modules (looking for node_modules, using aliases etc.) - and you can use the plugin to recognise angular modules - but if you rely on turning dotted module namespaces into directories, all the other goodies aren't available.
ColCh commentedon Jul 26, 2014
If you install angular commonjs module via
npm install angularnpm install angular-routerthen you able to
require('angular')orrequire('angular-route')'em without aliases (yeah!)For
ngRouterdependencies I wrote some hacks :) Please see 00f3530stackfull commentedon Jul 27, 2014
Updated with a few fixes, readme links to the angular-seed but I'd like to add a few more notes before closing this issue.
scottmas commentedon Sep 17, 2014
A recent update added a demo folder. This should be a good starting point I imagine.