fuse-box / fuse-box-aurelia-loader

MIT License
14 stars 2 forks source link

init-> package "xxxx" not working as excpected #5

Closed vegarringdal closed 7 years ago

vegarringdal commented 7 years ago

@nchanged @devmondo

I need some help here, because there is something Im not understanding, and its kinda stopping my progress

In the code under Im trying to make a basic package of the loader with all the aurelia libs needed But for some reason it will not have entry point

image

Ive tried with and without globals... is this a bug ?

let fuseLoader = fuse.init({
        package:"fuse-box-aurelia-loader",
        homeDir: "../src",
        outFile: "./bundle/fusebox-aurelia-bundle.js",
        globals:{"fuse-box-aurelia-loader":"fuse-box-aurelia-loader"},
        plugins: [
            fb.CSSPlugin(),
            fb.HTMLPlugin(),
            fb.TypeScriptHelpers()
    ]
})

fuseLoader.bundle(`>index.ts
    + aurelia-bootstrapper
    + aurelia-framework
    + aurelia-pal
    + aurelia-metadata
    + aurelia-loader-default
    + aurelia-polyfills
    + aurelia-fetch-client
    + aurelia-pal-browser
    + aurelia-animator-css
    + aurelia-logging-console 
    + aurelia-templating-binding 
    + aurelia-templating-resources 
    + aurelia-event-aggregator 
    + aurelia-history-browser 
    + aurelia-templating-router`
    );
nchanged commented 7 years ago

Are you loading that one in another bundle? If yes, https://github.com/fuse-box/fuse-box/issues/188 this will be released very soon and should fix it all!

vegarringdal commented 7 years ago

No

Im running this for the dev server

let appBundle = fuse.init({
    homeDir: "./src",
    outFile: "./bundle/app-bundle.js",
    useCache:false,
    plugins: [
        fb.CSSPlugin(),
        fb.HTMLPlugin({ useDefault: true }),
        fb.TypeScriptHelpers()
    ],
    sourceMap: {
        bundleReference: "./bundle/app-bundle.js.map",
        outFile: "./bundle/app-bundle.js.map",
    }
});

// Start dev server
appBundle.devServer(`
    > [main.ts]
    + [**/*.html] 
    + [**/*.ts] 
    + [**/*.css]
    `,{
   root: './'
})

But as you can see Ive lot loaded that separate bundle, so thats why Im asking if its a bug :-) Or if its me just doing something wrong

image

nchanged commented 7 years ago

Ok.. not sure i got you Have you tried

FuseBox.import("fuse-box-aurelia-loader")

in the console?

vegarringdal commented 7 years ago

yes :-)

Ive pretty much tried everything

image

atm I will hack it... :-) We can look more into this when Ive updated the sample, then you can look at code, better you spend time on the "addPackage" and bugs

//hack for now..
FuseBox.pkg("fuse-box-aurelia-loader", {}, function(___scope___) {
        ___scope___.entry = "index.js"
});
nchanged commented 7 years ago

Can you update fuse-box?

nchanged commented 7 years ago

If nothing helps, that's a bug. If you could write some steps, what to clone, what to run, and where to look =) I would appreciate that.

vegarringdal commented 7 years ago

using 1.3.116 now, deleted cache, same issue Even tried with and without: globals:{"fuse-box-aurelia-loader":"fuse-box-aurelia-loader"}, and deleted cache folder between.

Ill clean up the sample part Im working on, then I can more easily show you what/where :-)

nchanged commented 7 years ago

Sure! Thanks a lot!

vegarringdal commented 7 years ago

@nchanged Updated and cleaned up sample So now its ready for you to see if its a bug or not

1: git clone https://github.com/fuse-box/fuse-box-aurelia-loader

2: cd fuse-box-aurelia-loader/sample

3: npm install

4: Set breakpoint here https://github.com/fuse-box/fuse-box-aurelia-loader/blob/master/sample/src/main.ts#L4 Its really just to uncomment the "debugger" statement

5: Build it npm run build-all You have to be in sample catalog

6: Open app in broser, when it hits breakpoint you will se that entry is missing in the loader

image

nchanged commented 7 years ago

I will try that tomorrow! Could you create an issue in fuse-box referencing this one, so I won't forget? Thanks for the great job you are doing here! 🔥

vegarringdal commented 7 years ago

sure 👍

Will that part with addPackage be on the roadmap in the near future?

nchanged commented 7 years ago

at https://github.com/fuse-box/fuse-box/issues/194

nchanged commented 7 years ago

@vegarringdal absolutely! Just a couple releases with critical fixes, and then we get to the features!! yum!

vegarringdal commented 7 years ago

Great, keep up the good work, fusebox is a lot more fun then any other bundling Ive been doing, but havent really been doing any... was so boring 😂