mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
separate config for app and mobile
This commit is contained in:
@@ -36,6 +36,7 @@ const portal = new MagicPortal(worker);
|
||||
<script defer src="./js/ui.js"></script>
|
||||
<script defer src="./js/amplify.js"></script>
|
||||
<script defer src="./ionic.js"></script>
|
||||
<script defer src="./js/main-bundle.js"></script>
|
||||
<script defer src="./js/shared.js"></script>
|
||||
<script defer src="./js/main.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -113,11 +113,17 @@
|
||||
shadow.remote.runtime.cljs.browser]}}
|
||||
:mobile {:target :browser
|
||||
:module-loader true
|
||||
:js-options {:ignore-asset-requires true
|
||||
:js-options {:js-provider :external
|
||||
:external-index "target/mobile.js"
|
||||
:external-index-format :esm
|
||||
:entry-keys ["module" "browser" "main"]
|
||||
:export-conditions ["module" "import", "browser" "require" "default"]
|
||||
:ignore-asset-requires true
|
||||
:resolve {"react" {:target :global
|
||||
:global "React"}
|
||||
"react-dom" {:target :global
|
||||
:global "ReactDOM"}}} ;; handle `require(xxx.css)`
|
||||
:global "ReactDOM"}}}
|
||||
;; handle `require(xxx.css)`
|
||||
:modules {:shared
|
||||
{:entries []}
|
||||
:main
|
||||
|
||||
@@ -1,24 +1,12 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
var config = {
|
||||
mode: "development",
|
||||
entry: {
|
||||
main : "./target/main.js",
|
||||
workers : "./target/workers.js"
|
||||
},
|
||||
|
||||
externals: {
|
||||
'react': 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
},
|
||||
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'static/js'),
|
||||
filename: '[name]-bundle.js',
|
||||
clean: false,
|
||||
chunkLoading: false,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
@@ -37,3 +25,37 @@ module.exports = {
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
var AppConfig = Object.assign({}, config, {
|
||||
name: "app",
|
||||
entry: {
|
||||
main : "./target/main.js",
|
||||
workers : "./target/workers.js",
|
||||
},
|
||||
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'static/js'),
|
||||
filename: '[name]-bundle.js',
|
||||
clean: false,
|
||||
chunkLoading: false,
|
||||
},
|
||||
});
|
||||
|
||||
var MobileConfig = Object.assign({}, config, {
|
||||
name: "app",
|
||||
entry: {
|
||||
main : "./target/mobile.js",
|
||||
workers : "./target/workers.js",
|
||||
},
|
||||
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'static/mobile/js'),
|
||||
filename: '[name]-bundle.js',
|
||||
clean: false,
|
||||
chunkLoading: false,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = [
|
||||
AppConfig, MobileConfig,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user