refactor: build

This commit is contained in:
cha0s 2023-11-26 12:32:48 -06:00
parent ddc1b55a79
commit 4bb8d72e0c
3 changed files with 12 additions and 18 deletions

View File

@ -1,12 +0,0 @@
module.exports = async (flecks) => {
// eslint-disable-next-line import/no-extraneous-dependencies, global-require
const config = await require('@flecks/fleck/server/build/fleck.neutrinorc')(flecks);
config.use.push(({config}) => {
config.module
.rule('glsl')
.test(/\.(frag|glsl|vert)$/)
.use('glsl')
.loader(require.resolve('webpack-glsl-loader'));
});
return config;
};

View File

@ -0,0 +1,9 @@
module.exports = async (env, argv, flecks) => {
// eslint-disable-next-line import/no-extraneous-dependencies, global-require
const config = await require('@flecks/fleck/server/build/fleck.webpack.config')(env, argv, flecks);
config.module.rules.push({
test: /\.(frag|glsl|vert)$/,
use: ['webpack-glsl-loader'],
});
return config;
};

View File

@ -1,11 +1,8 @@
export const hooks = {
'@flecks/core.build': (target, config) => {
config.use.push(({config}) => {
config.module
.rule('glsl')
.test(/\.(frag|glsl|vert)$/)
.use('glsl')
.loader(require.resolve('webpack-glsl-loader'));
config.module.rules.push({
test: /\.(frag|glsl|vert)$/,
use: ['webpack-glsl-loader'],
});
},
};