chore: Added non webpack-chain example

This commit is contained in:
Laegel
2020-05-27 15:42:06 +02:00
parent bd59f08d29
commit 4b61ce6a9d

View File

@@ -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