Files
logseq/webpack.config.js
2025-09-01 10:27:34 +08:00

61 lines
1.2 KiB
JavaScript

const path = require('path');
const webpack = require('webpack');
var config = {
mode: "development",
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
},
module: {
rules: [
{
// docs: https://webpack.js.org/configuration/module/#resolvefullyspecified
test: /\.m?js/,
resolve: {
fullySpecified: false,
}
}
]
},
plugins: [
// fix "process is not defined" error:
new webpack.ProvidePlugin({
process: 'process/browser',
}),
],
};
var AppConfig = Object.assign({}, config, {
name: "app",
entry: {
"db-worker" : "./target/db-worker.js",
"inference-worker" : "./target/inference-worker.js"
},
output: {
path: path.resolve(__dirname, 'static/js'),
filename: '[name]-bundle.js',
clean: false,
chunkLoading: false,
},
});
var MobileConfig = Object.assign({}, config, {
name: "mobile",
entry: {
"db-worker" : "./target/db-worker.js",
},
output: {
path: path.resolve(__dirname, 'static/mobile/js'),
filename: '[name]-bundle.js',
clean: false,
chunkLoading: false,
},
});
module.exports = [
AppConfig, MobileConfig,
];