feat: per-entry styles
This commit is contained in:
parent
ed2aa6a3c1
commit
d43316a436
|
@ -18,7 +18,7 @@ const augmentBuild = (target, config, flecks) => {
|
|||
if ('fleck' === target) {
|
||||
extract.enabled = true;
|
||||
extract.plugin = {
|
||||
filename: 'index.css',
|
||||
filename: '[name].css',
|
||||
};
|
||||
}
|
||||
neutrino.use(
|
||||
|
|
|
@ -28,9 +28,22 @@ module.exports = async (flecks) => {
|
|||
const styles = (
|
||||
await Promise.all(
|
||||
roots
|
||||
.map(async ([, path]) => {
|
||||
.map(([, path]) => {
|
||||
try {
|
||||
const {files} = R(join(path, 'package.json'));
|
||||
return (
|
||||
files
|
||||
.filter((name) => name.match(/\.css$/))
|
||||
.map((name) => join(path, name))
|
||||
);
|
||||
}
|
||||
catch (error) {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
.flat()
|
||||
.map(async (filename) => {
|
||||
try {
|
||||
const filename = join(path, 'index.css');
|
||||
await stat(filename);
|
||||
return filename;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user