jonespen / kss-webpack-plugin

Generate KSS styleguide from Webpack
MIT License
10 stars 10 forks source link

Root Asset Loading Path #8

Open harlan-zw opened 6 years ago

harlan-zw commented 6 years ago

Not sure if this is an issue with some other configuration but thought i'd flag it either way.

When you are using the chunks option within the configuration, all assets are loading from the project root by default. As far as I can tell, it doesn't let you specify the root web path to load these assets from.

I'd send a PR but I don't think my fix is the best approach. I just passed in an additional configuration and the used that. I'm guessing you can get the webpack option of output.publicPath

  if (ext === '.css') {
                assets.css.push(path.join('/', path.join(options.assetPath, file)))
            } else if (ext === '.js') {
                assets.js.push(path.join('/', path.join(options.assetPath, file)));
            }