Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Create Build command for deployment #46

Closed
deepakgd opened this issue Mar 4, 2016 · 8 comments
Closed

Create Build command for deployment #46

deepakgd opened this issue Mar 4, 2016 · 8 comments

Comments

@deepakgd
Copy link

deepakgd commented Mar 4, 2016

Like angular/angular-cli can you create dist folder automatically for deployment purpose

@skovmand
Copy link

+1 Preferably including minification

@PatrickJS
Copy link
Member

There's (beta.1-beta.9) currently a problem with minification. I can see if there is a setup that makes sense without introducing complexity

@deepakgd
Copy link
Author

ok do mangle: false to avoid minification issue now. Good solution need to find soon

@skovmand
Copy link

@gdi2290 Okay.. I'm actually glad to hear there's still a minification issue in beta 9, since I have been struggling with it. It's not only me, then. I just rely on gzipping for now. No minification at all, but looking forward to reducing the bundle size!

@zachgrayio
Copy link

zachgrayio commented Apr 15, 2016

This is actually pretty easy to do on your own, assuming you've got this in your webpack config:
output: { path: path.join(__dirname, 'dist') },
you can just modify/add the build task in package.json like so to include your html:
"build:dev": "./node_modules/.bin/webpack --inline --colors --progress --display-error-details --display-cached && cp src/index.dev.html dist/index.html",, and then create your dist folder by running npm run build:dev etc.

And if you've added sass/css plugins to webpack, just make sure you include the css bundle in your html file, and then you can import the sass/css files as needed in your components, via import 'stylesheets/my_stylez'

@zachgrayio
Copy link

And as far as minification goes, so far it seems like webpack.optimize.UglifyJsPlugin() with minimize=true seems to be working out pretty well on ng2 beta.13, so that's worth a shot if you're adding a build task.

@piotrromanowski
Copy link

@zachgrayio how did you get the component html templates to load in dist? when opening the index.html I receive Failed to load resouce: the server responded with a status 404 (Not Found) app/seed-app.html

@pkozlowski-opensource
Copy link
Member

Duplicate of #17. I think it will make sense to do this only once offline compilation works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants