mirror of
https://github.com/tauri-apps/tauri-webpack.git
synced 2026-02-04 02:31:17 +01:00
chore: Added non webpack-chain example
This commit is contained in:
33
README.md
33
README.md
@@ -5,11 +5,38 @@
|
||||
|
||||
The webpack tools currently used by the Tauri `no-server` mode.
|
||||
|
||||
### Setup
|
||||
### Install
|
||||
|
||||
```bash
|
||||
yarn add @tauri-apps/tauri-webpack
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
```js
|
||||
const mode = process.env.NODE_ENV || 'development'
|
||||
const devMode = mode !== 'production'
|
||||
const tauriMode = !!process.env.TAURI
|
||||
|
||||
const webpackConfig = {
|
||||
entry: {
|
||||
bundle: ['./src-ui/index.js']
|
||||
},
|
||||
... CONFIG HERE
|
||||
}
|
||||
|
||||
if (tauriMode) {
|
||||
const merge = require('webpack-merge')
|
||||
const tauriWebpackConfig = require('@tauri-apps/tauri-webpack').config()
|
||||
module.exports = merge(webpackConfig, tauriWebpackConfig)
|
||||
}
|
||||
else {
|
||||
module.exports = webpackConfig
|
||||
}
|
||||
```
|
||||
|
||||
### Usage with webpack-chain
|
||||
|
||||
In your webpack config:
|
||||
```js
|
||||
chainWebpack (chain) {
|
||||
@@ -29,5 +56,5 @@ tauri: {
|
||||
## Please visit https://github.com/tauri-apps/tauri for details about contributing and community.
|
||||
|
||||
## License
|
||||
Copyright (c) 2019 Tauri
|
||||
MIT
|
||||
Copyright (c) 2020 Tauri
|
||||
MIT
|
||||
|
||||
Reference in New Issue
Block a user