feat: auto styles

This commit is contained in:
cha0s 2021-01-26 23:24:54 -06:00
parent 55f113bf02
commit 718813bc61

View File

@ -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}`);