im just making sure i do things right so,
How do i set the urlpath for css/js files in index.html? (production build)
for i.e the default url for css is href="/style.xxxx.css", how can i set it to href="/static/css/style.xxxx.css.? or better yet, is it possible to choose the output path for these?
i want to have:
href="/static/css/style.xxx.css for csssrc="/static/js/bundle.xxx.js for jsin a nutshell i just want to prefix /static/<type>/<filename> in index.html.
is it possible without manually editing?
I'm not sure about splitting by type, but to add a prefix to the paths:
Create a preact.config.js file in your project root folder and add the following contents:
```js
export default function (config, env, helpers) {
if ( env.production ) {
config.output.publicPath = '/static/';
}
}
I don't think this is actually supported even in Webpack.
I guess we could do that by changing css outputPath from [name].[contenthash:5].css to static/css/[name].[contenthash:5].css and js outputPath from [name].[chunkhash:5].js to static/js/[name].[chunkhash:5].js.
These can be changed with the help of preact.config.js but I don't know how to do that in actual code 馃槄.
Most helpful comment
I'm not sure about splitting by type, but to add a prefix to the paths:
Create a
preact.config.jsfile in your project root folder and add the following contents:```js
export default function (config, env, helpers) {
if ( env.production ) {
config.output.publicPath = '/static/';
}
}