feat: auto styles
This commit is contained in:
parent
55f113bf02
commit
718813bc61
|
@ -45,10 +45,37 @@ module.exports = {
|
|||
const testEntry = neutrino.config.entry('test').clear();
|
||||
testPaths.forEach((path) => testEntry.add(path));
|
||||
}
|
||||
const cssPaths = glob.sync('./src/**/*.{css,scss}');
|
||||
if (cssPaths.length > 0) {
|
||||
const cssEntry = neutrino.config.entry('index.css').clear();
|
||||
cssPaths.forEach((path) => cssEntry.add(path));
|
||||
}
|
||||
neutrino.options.output = '.';
|
||||
react({
|
||||
clean: false,
|
||||
hot: false,
|
||||
style: {
|
||||
extract: {
|
||||
enabled: false,
|
||||
},
|
||||
test: /\.(css|sass|scss)$/,
|
||||
modulesTest: /\.module\.(css|sass|scss)$/,
|
||||
loaders: [
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
useId: 'postcss',
|
||||
options: {
|
||||
config: {
|
||||
path: process.cwd(),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader',
|
||||
useId: 'sass',
|
||||
},
|
||||
],
|
||||
},
|
||||
})(neutrino);
|
||||
Object.keys(neutrino.options.mains).forEach((main) => {
|
||||
neutrino.config.plugins.delete(`html-${main}`);
|
||||
|
|
Loading…
Reference in New Issue
Block a user