Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work with assets-webpack-plugin #31

Open
mastilver opened this issue Sep 15, 2017 · 6 comments
Open

Make it work with assets-webpack-plugin #31

mastilver opened this issue Sep 15, 2017 · 6 comments

Comments

@mastilver
Copy link
Owner

https://github.com/kossnocorp/assets-webpack-plugin

@mastilver mastilver changed the title Make it work with: https://github.com/kossnocorp/assets-webpack-plugin Make it work with assets-webpack-plugin Sep 15, 2017
@aulisius
Copy link
Collaborator

aulisius commented Aug 29, 2018

Was looking through the plugin. How exactly would this plugin work with assets-webpack-plugin ? The json that is emitted would contain the CDN urls for the libraries?

@mastilver
Copy link
Owner Author

yeah, same as manifest-webpack-plugin

I have no idea if there is something to do, maybe just a unit test would be enough?

@aulisius
Copy link
Collaborator

Hmm.

So for the following webpack config,

{
    context: path.resolve(__dirname, './fixtures/app'),

    output: {
        publicPath: '',
        path: path.resolve(__dirname, './fixtures/output/assets-webpack-plugin')
    },

    entry: {
        app: './single.js'
    },

    plugins: [
        new AssetsPlugin({
            filename: 'assets.json',
            useCompilerPath: true
        }),
        new DynamicCdnWebpackPlugin()
    ]
}

and single.js being

import React from 'react'

The JSON file that is generated contains the following.

{
    "app": {
        "js": "app.js"
    }
}

This kinda looks like the intended behaviour, but that means assets-webpack-plugin has no explicit effect on dynamic-cdn-webpack plugin.

@mastilver
Copy link
Owner Author

but the output, will not include react, right?
No idea how they work, need to dig into the code

@aulisius
Copy link
Collaborator

Yes. I got that. But like I said

assets-webpack-plugin has no explicit effect on dynamic-cdn-webpack-plugin.

This becomes an non-issue.

@mastilver
Copy link
Owner Author

Does it? 🤔

If app.js doesn't include react and the JSON doesn't reference it, how are developer going to know to include it or not?

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

No branches or pull requests

2 participants