-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tauri): support for building without environmental variables (…
…#850) Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
- Loading branch information
1 parent
bffbf7d
commit e02c941
Showing
60 changed files
with
1,302 additions
and
947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"tauri-utils": minor | ||
"tauri-api": minor | ||
"tauri": minor | ||
--- | ||
|
||
The Tauri files are now read on the app space instead of the `tauri` create. | ||
Also, the `AppBuilder` `build` function now returns a Result. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
members = [ | ||
"tauri", | ||
"tauri-api", | ||
"tauri-macros", | ||
"tauri-utils", | ||
] | ||
exclude = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
singleQuote: true, | ||
semi: false, | ||
trailingComma: 'none' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
"@babel/preset-env", | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: "current", | ||
node: 'current' | ||
}, | ||
modules: "commonjs", | ||
}, | ||
modules: 'commonjs' | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
], | ||
}; | ||
'@babel/preset-typescript' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,107 @@ | ||
// rollup.config.js | ||
import { terser } from "rollup-plugin-terser"; | ||
import resolve from "@rollup/plugin-node-resolve"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import sucrase from "@rollup/plugin-sucrase"; | ||
import babel, { getBabelOutputPlugin } from "@rollup/plugin-babel"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import pkg from "./package.json"; | ||
import { terser } from 'rollup-plugin-terser' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import sucrase from '@rollup/plugin-sucrase' | ||
import babel, { getBabelOutputPlugin } from '@rollup/plugin-babel' | ||
import typescript from '@rollup/plugin-typescript' | ||
import pkg from './package.json' | ||
|
||
export default [ | ||
{ | ||
input: { | ||
fs: "./src/fs.ts", | ||
path: "./src/path.ts", | ||
dialog: "./src/dialog.ts", | ||
event: "./src/event.ts", | ||
http: "./src/http.ts", | ||
index: "./src/index.ts", | ||
process: "./src/process.ts", | ||
tauri: "./src/tauri.ts", | ||
window: "./src/window.ts", | ||
cli: "./src/cli.ts", | ||
notification: "./src/notification.ts", | ||
fs: './src/fs.ts', | ||
path: './src/path.ts', | ||
dialog: './src/dialog.ts', | ||
event: './src/event.ts', | ||
http: './src/http.ts', | ||
index: './src/index.ts', | ||
process: './src/process.ts', | ||
tauri: './src/tauri.ts', | ||
window: './src/window.ts', | ||
cli: './src/cli.ts', | ||
notification: './src/notification.ts' | ||
}, | ||
treeshake: true, | ||
perf: true, | ||
output: [ | ||
{ | ||
dir: "dist/", | ||
entryFileNames: "[name].js", | ||
format: "cjs", | ||
exports: "named", | ||
globals: {}, | ||
dir: 'dist/', | ||
entryFileNames: '[name].js', | ||
format: 'cjs', | ||
exports: 'named', | ||
globals: {} | ||
}, | ||
{ | ||
dir: "dist/", | ||
entryFileNames: "[name].mjs", | ||
format: "esm", | ||
exports: "named", | ||
globals: {}, | ||
}, | ||
dir: 'dist/', | ||
entryFileNames: '[name].mjs', | ||
format: 'esm', | ||
exports: 'named', | ||
globals: {} | ||
} | ||
], | ||
plugins: [ | ||
commonjs({}), | ||
resolve({ | ||
// pass custom options to the resolve plugin | ||
customResolveOptions: { | ||
moduleDirectory: "node_modules", | ||
}, | ||
moduleDirectory: 'node_modules' | ||
} | ||
}), | ||
typescript({ | ||
tsconfig: "./tsconfig.json", | ||
tsconfig: './tsconfig.json' | ||
}), | ||
babel({ | ||
configFile: false, | ||
presets: [["@babel/preset-env"], ["@babel/preset-typescript"]], | ||
presets: [['@babel/preset-env'], ['@babel/preset-typescript']] | ||
}), | ||
terser(), | ||
terser() | ||
], | ||
external: [ | ||
...Object.keys(pkg.dependencies || {}), | ||
...Object.keys(pkg.peerDependencies || {}), | ||
...Object.keys(pkg.peerDependencies || {}) | ||
], | ||
watch: { | ||
chokidar: true, | ||
include: "src/**", | ||
exclude: "node_modules/**", | ||
}, | ||
include: 'src/**', | ||
exclude: 'node_modules/**' | ||
} | ||
}, | ||
{ | ||
input: { | ||
bundle: "./src/bundle.ts", | ||
bundle: './src/bundle.ts' | ||
}, | ||
output: [ | ||
{ | ||
name: "__TAURI__", | ||
dir: "dist/", // if it needs to run in the browser | ||
entryFileNames: "tauri.bundle.umd.js", | ||
format: "umd", | ||
name: '__TAURI__', | ||
dir: 'dist/', // if it needs to run in the browser | ||
entryFileNames: 'tauri.bundle.umd.js', | ||
format: 'umd', | ||
plugins: [ | ||
getBabelOutputPlugin({ | ||
presets: [["@babel/preset-env", { modules: "umd" }]], | ||
allowAllFormats: true, | ||
presets: [['@babel/preset-env', { modules: 'umd' }]], | ||
allowAllFormats: true | ||
}), | ||
terser(), | ||
terser() | ||
], | ||
globals: {}, | ||
}, | ||
globals: {} | ||
} | ||
], | ||
plugins: [ | ||
sucrase({ | ||
exclude: ["node_modules"], | ||
transforms: ["typescript"], | ||
exclude: ['node_modules'], | ||
transforms: ['typescript'] | ||
}), | ||
resolve({ | ||
// pass custom options to the resolve plugin | ||
customResolveOptions: { | ||
moduleDirectory: "node_modules", | ||
}, | ||
}), | ||
moduleDirectory: 'node_modules' | ||
} | ||
}) | ||
], | ||
external: [ | ||
...Object.keys(pkg.dependencies || {}), | ||
...Object.keys(pkg.peerDependencies || {}), | ||
], | ||
}, | ||
]; | ||
...Object.keys(pkg.peerDependencies || {}) | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.