arackaf / customize-cra

Override webpack configurations for create-react-app 2.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setWebpackPublicPath auto option

danielweil opened this issue · comments

Webpack supports "auto" value for publicPath.

Can this package support it too?

Would be excelent.

Thanks for all your work!

const setCustomWebpackPublicPath = (path) => (config) => { if (path) { if (path !== 'auto') { if (!(path.startsWith('http') || path.startsWith('https'))) { if (!path.startsWith('/')) { path = '/' + path; } } if (!path.endsWith('/')) { path = path + '/'; } } config.output.publicPath = path; } return config; };