feat: CSS modules
This commit is contained in:
parent
6d26638cc8
commit
b9018fdaa1
|
@ -38,12 +38,9 @@ module.exports = (async () => {
|
|||
}]);
|
||||
// Entrypoints.
|
||||
const {output: originalOutput} = options;
|
||||
options.root = root;
|
||||
config.context(options.root);
|
||||
options.source = '.';
|
||||
options.mains.index = 'entry';
|
||||
options.mains.index = join(root, 'entry');
|
||||
options.mains.tests = {
|
||||
entry: './client/tests',
|
||||
entry: join(root, 'client', 'tests'),
|
||||
title: 'Testbed',
|
||||
};
|
||||
options.output = join(originalOutput, flecks.get('@flecks/http/server.output'));
|
||||
|
@ -84,7 +81,7 @@ module.exports = (async () => {
|
|||
.publicPath('/')
|
||||
.filename(isProduction ? 'assets/[name].[contenthash:8].js' : 'assets/[name].js');
|
||||
config
|
||||
.devtool(isProduction ? 'source-map' : 'eval-source-map')
|
||||
.devtool('source-map')
|
||||
.target('web');
|
||||
config.node
|
||||
.set('Buffer', true)
|
||||
|
|
|
@ -12,14 +12,22 @@ const debug = D('@flecks/http/server');
|
|||
export default {
|
||||
[Hooks]: {
|
||||
'@flecks/core.build': (target, config) => {
|
||||
config.use.push(styleLoader({
|
||||
extract: {
|
||||
enabled: false,
|
||||
},
|
||||
style: {
|
||||
injectType: 'lazyStyleTag',
|
||||
},
|
||||
}));
|
||||
config.use.push((neutrino) => {
|
||||
const isProduction = 'production' === neutrino.config.get('mode');
|
||||
neutrino.use(
|
||||
styleLoader({
|
||||
extract: {
|
||||
enabled: false,
|
||||
},
|
||||
modules: {
|
||||
localIdentName: isProduction ? '[hash]' : '[path][name]__[local]',
|
||||
},
|
||||
style: {
|
||||
injectType: 'lazyStyleTag',
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
config.use.push(fontLoader());
|
||||
config.use.push(imageLoader());
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user