Open mastilver opened 7 years ago
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?
yeah, same as manifest-webpack-plugin
I have no idea if there is something to do, maybe just a unit test would be enough?
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.
but the output, will not include react
, right?
No idea how they work, need to dig into the code
Yes. I got that. But like I said
assets-webpack-plugin
has no explicit effect ondynamic-cdn-webpack-plugin
.
This becomes an non-issue.
Does it? :thinking:
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?
https://github.com/kossnocorp/assets-webpack-plugin