alex-klock / ng2-fused Goto Github PK
View Code? Open in Web Editor NEWFuseBox plugins and utilities for building Angular2 applications.
License: MIT License
FuseBox plugins and utilities for building Angular2 applications.
License: MIT License
Hi!
Wanted to say how amazing this plugin is. Could you update it to the latest fusebox version?
We are about to release 2.0 - a major release with many changes. And your plugins works like a charm.
It should be a part of ng2-example.
That's the full config I personally tested with 2.0.0-beta.19
const {
FuseBox,
SassPlugin,
CSSPlugin,
WebIndexPlugin,
TypeScriptHelpers,
JSONPlugin,
HTMLPlugin,
UglifyJSPlugin,
RawPlugin
} = require('fuse-box');
const { Ng2TemplatePlugin } = require('ng2-fused');
const path = require("path");
const fuse = FuseBox.init({
homeDir: `src/`,
output: `dist/$name.js`,
plugins: [
WebIndexPlugin({
title: "FuseBox + Angular",
template: "src/angular/index.html"
}),
// https://github.com/alex-klock/ng2-fused
Ng2TemplatePlugin(),
// styles
['angular/main.scss', SassPlugin(), CSSPlugin()],
['angular/components/todo/**.scss', SassPlugin(), RawPlugin()],
// etc
JSONPlugin(),
HTMLPlugin({ useDefault: false })
]
});
// setup development sever
fuse.dev({ port: 3000 });
// bundle vendor
fuse.bundle("vendor")
.hmr()
.instructions("~ angular/main.ts")
// bundle application
fuse.bundle("app")
.sourceMaps(true)
.instructions(" !> [angular/main.ts]").watch().hmr()
// run the factory
fuse.run();
Thanks a million!
2.0 of fuse-box added a lazyLoad utility from "fuse-tools" package... let's utilize that.
Hi Alex, thanks for the plugin, it looks very promising.
I'm sorry to ask here but there's not much support for fusebox still out there.
I'm using your plugin to use templateUrl and stylesUrl in my app and with my configuration
plugins: [
[SassPlugin(), CSSPlugin()],
CSSPlugin(),
Ng2TemplatePlugin()
]
I see in my bundled app.js that the regular imports have been converted to
AppComponent = __decorate([
core_1.Component({
selector: 'app',
template: '\n <arc-form></arc-form>\n ',
styles: [require('./app.component.scss')],
encapsulation: core_1.ViewEncapsulation.None
}),
so, my template has been imported directly and the styles transformed to a require.
As I already have [SassPlugin(), CSSPlugin()],
configured, shouldn´t this work already as it is?
Why do you recommend to use RawPlugin instead?
plugins: [
Ng2TemplatePlugin(),
['*.component.html', RawPlugin()],
['*.component.css', RawPlugin()]
// or with a css pre/post processor...
// ['*.component.css', PostCss([precss()]), RawPlugin()]
]
Thanks!
Is is possible convert .scss to css then use this plugin? I would like to maintain the .css in the angular app stylesUrl, but can't seem to figure it out yet. FuseBox is awesome so far, but need to know if a few things can work before moving larger apps to this build tooling.
I know, its on your roadmap,
but currently, how would you bundle the modules from @angular/router ?
i tried to make a simple bundle via fuse only with the modules loaded by the router, but couldn't get it working. Better say, i don't know how;)
Thanks, Micha.
Hey Alex,
I am using ionic2 to build an app and I am also using fusebox and your plugin to build the app.
To make switching as easy as possible it would be nice to automatically require the .scss files with the same name as the templateUrl as this is what ionic-app-scripts does out of the box.
I have forked your repo and did a (quick and dirty) fix.
https://github.com/mitsoe/ng2-fused
I was wondering if you could implement similar functionality in your plugin aswel.
Kind regards,
Mitch
Does your plugin support nested lazy modules (folder within folder using + syntax)?
Hi,
it seems that generated sourcemaps end up wrong when using this plugin.
See this issue fuse-box/fuse-box#877
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.