Closed CKGrafico closed 7 years ago
Suggestion, As I told on an issue, I don't like the queryparemeters flow but I think this is the smallest change that I can suggest.
Another suggestion is to generate the .css file from .html name but maybe is too magic.
Another way to solve that (probably better) is to add a option to use the same folder for .html and .css I can implement it if you want
Thanks for your PR. However I'm not a fan of adding a feature that we already achieve with a webpack feature.
In your case, you can set resolve.modules
option in webpack config.
module.exports = {
resolve: {
modules: [
path.resolve('/path/to/css'),
'node_modules'
]
}
}
Thank you're right, now we have:
modules: [
path.resolve(__dirname, 'dist/css/scripts'),
'node_modules'
],
app.component.ts
import Template from './app.component.html?style=app.component.css';
but for children
import Template from './city-list.component.html?style=cities/city-list/city-list.component.css';
Not sure if we can resolve all the children folders with one resolve
Hmm, in that case, you should copy all js/html files to dist
directory in build time? I think it would be the easiest solution than hacking webpack config.
The improvement is to change your flow from relative folder to file name if you want:
before:
after:
Why? Sometimes you don't want to compile your style preprocesor with webpack and you have all the files compiled separately, this with help also on other workflows.