diff options
author | Saúl Ibarra Corretgé <s@saghul.net> | 2018-08-16 10:58:56 +0200 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2018-08-17 23:06:46 +0200 |
commit | c50e6344f7d9e59a7e28411de8878ecaf9fc58f3 (patch) | |
tree | 778aaece533d55ca2a379e81bb986c4e3cb3db6f /webpack.renderer.js | |
parent | 7c23809c2a08ecd75057fdd6aa717f3ba2f2790f (diff) |
Add ability to watch / autoreload in development mode
Fixes: https://github.com/jitsi/jitsi-meet-electron/issues/103
Co-authored-by: Akshit Kr Nagpal <akshitkrnagpal@gmail.com>
Diffstat (limited to 'webpack.renderer.js')
-rw-r--r-- | webpack.renderer.js | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/webpack.renderer.js b/webpack.renderer.js new file mode 100644 index 0000000..e660832 --- /dev/null +++ b/webpack.renderer.js @@ -0,0 +1,73 @@ +const path = require('path'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +const ELECTRON_VERSION = require('./package.json').devDependencies.electron; + +module.exports = { + target: 'electron-renderer', + entry: { app: './app/index.js' }, + plugins: [ + new HtmlWebpackPlugin({ + template: './app/index.html' + }) + ], + output: { + path: path.resolve('./build'), + filename: '[name].js' + }, + node: { + __dirname: true + }, + module: { + rules: [ + { + exclude: /node_modules(?!(\/|\\)js-utils)/, + loader: 'babel-loader', + options: { + babelrc: false, + presets: [ + [ + require.resolve('babel-preset-env'), + { + modules: false, + targets: { + electron: ELECTRON_VERSION + } + } + ], + require.resolve('babel-preset-react'), + require.resolve('babel-preset-stage-1') + ], + plugins: [ + require.resolve('babel-plugin-inline-react-svg') + ] + }, + test: /\.js$/ + }, + { + use: [ + { loader: 'style-loader' }, + { loader: 'css-loader' } + ], + test: /\.css$/ + }, + { + use: 'file-loader', + test: /\.png$/ + }, + { + loader: 'svg-inline-loader', + test: /\.svg$/ + } + ] + }, + externals: [ { + 'jitsi-meet-electron-utils': 'require(\'jitsi-meet-electron-utils\')' + } ], + resolve: { + modules: [ + path.resolve('./node_modules') + ] + } +}; + |