1 Star 0 Fork 0

xuejianxinokok/webgpu-samples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
next.config.js 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
const path = require('path');
const fs = require('fs');
const BASE_PATH = process.env.BASE_PATH || '';
module.exports = {
output: 'standalone',
basePath: BASE_PATH,
compress: true,
reactStrictMode: true,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: /\.(png|jpe?g|gif|webm)$/i,
type: 'asset/resource',
generator: {
filename: 'static/[path][name].[hash][ext]'
}
});
config.module.rules.push({
test: /\.wgsl$/i,
use: 'raw-loader',
});
config.plugins.push(new webpack.DefinePlugin({
__SOURCE__: webpack.DefinePlugin.runtimeValue((v) => {
// Load the source file and set it as a global definition.
// This is useful for easily embedding a file's source into the page.
const source = fs.readFileSync(v.module.userRequest, 'utf-8');
return JSON.stringify(source); // Strings need to be wrapped in quotes
}, []),
})
);
if (!config.node) {
config.node = {};
}
config.node.__filename = true;
config.node.__dirname = true;
return config;
},
env: {
REPOSITORY_NAME: process.env.REPOSITORY_NAME,
},
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/xuejianxinokok/webgpu-samples.git
git@gitee.com:xuejianxinokok/webgpu-samples.git
xuejianxinokok
webgpu-samples
webgpu-samples
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385