From 9c57d101f0181aa134190edb0b2e7aabdba1151f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 20 Aug 2019 14:51:06 +0400 Subject: Added example application Signed-off-by: Valentin Popov --- example/application/webpack.config.js | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 example/application/webpack.config.js (limited to 'example/application/webpack.config.js') diff --git a/example/application/webpack.config.js b/example/application/webpack.config.js new file mode 100644 index 0000000..87387dc --- /dev/null +++ b/example/application/webpack.config.js @@ -0,0 +1,69 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin') + +const path = require('path') + +const mainConfig = { + devtool: 'source-map', + mode: 'development', + target: 'electron-main', + entry: { + main: './src/main.js' + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].js' + }, + node: { + __dirname: true, + __filename: true + }, + module: { + rules: [{ + test: /\.js$/, + exclude: /(node_modules|bower_components)/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + ignore: ['../../dist/**/*.js'], + plugins: ['@babel/plugin-transform-runtime'], + presets: ['@babel/preset-env'] + } + } + }] + } +} + +const rendererConfig = { + devtool: 'source-map', + mode: 'development', + target: 'electron-renderer', + entry: { + renderer: './src/renderer.js' + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].js' + }, + plugins: [ + new HtmlWebpackPlugin({ + template: './src/index.html', + title: 'Test Application' + }) + ], + module: { + rules: [{ + test: /\.(js|jsx)$/i, + exclude: /(node_modules|bower_components)/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + presets: ['@babel/preset-env'] + } + } + }] + } +} + +module.exports = [mainConfig, rendererConfig] -- cgit v1.2.3