epicmaxco / epic-spinners

Easy to use css spinners collection with Vue.js integration
https://epic-spinners.epicmax.co
3.84k stars 357 forks source link

Webpack build conf for cdn lib doesn't seem to work #16

Closed sreecodeslayer closed 5 years ago

sreecodeslayer commented 6 years ago

I was about to use the package served via CDN for a project when I realised the minification have issues in jsdelivr and seems to point to wrong file there.

Anyways, I tried using the file that's already in the repo's dist/lib , but it doesn't expose the root object globally.

For a quick fix, I changed the output for webpack.lib.conf from

output: {
    path: config.lib.assetsRoot,
    filename: utils.assetsLibPath('[name].min.js'),
    library: '[name]',
    libraryTarget: 'umd'
}
.
.
.
// extract css into its own file
new ExtractTextPlugin({
    filename: utils.assetsLibPath('[name].min.css')
}),

into

output: {
    path: config.lib.assetsRoot,
    filename: utils.assetsLibPath('epicspinners.min.js'),
    library: 'epicspinners',
    libraryTarget: 'umd'
}
.
.
.
// extract css into its own file
new ExtractTextPlugin({
    filename: utils.assetsLibPath('epicspinners.min.css')
}),

and the global object is back :slightly_smiling_face: