Skip to content

TagSpaces is an offline, open source, document manager with tagging support

cleaning old configs

Ilian Sapundshiev9c58ac5a30dd
diff --git a/webpack.config.renderer.cordova.js b/configs/webpack.config.renderer.cordova.js
similarity index 100%
rename from webpack.config.renderer.cordova.js
rename to configs/webpack.config.renderer.cordova.js
diff --git a/webpack.config.base.js b/webpack.config.base.js
deleted file mode 100644
index d2c3abead..000000000
--- a/webpack.config.base.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Base webpack config used across other specific configs
- */
-
-import path from 'path';
-import webpack from 'webpack';
-// import { dependencies as externals } from './app/package.json';
-
-export default {
- // externals: Object.keys(externals || {}),
-
- module: {
- rules: [
- {
- test: /\.jsx?$/,
- // exclude: path.resolve(__dirname, '/node_modules/'),
- // exclude: /node_modules/,
- include: [/app/],
- use: {
- loader: 'babel-loader',
- options: {
- cacheDirectory: true
- }
- }
- }
- ]
- },
-
- output: {
- path: path.join(__dirname, 'app'),
- filename: 'bundle.js',
- // https://github.com/webpack/webpack/issues/1114
- libraryTarget: 'commonjs2'
- // publicPath: 'dist/',
- },
-
- /**
- * Determine the array of extensions that should be used to resolve modules.
- */
- resolve: {
- extensions: ['.js', '.jsx', '.json'],
- modules: [path.join(__dirname, 'app'), 'node_modules'],
- symlinks: false
- /* alias: {
- "react": "preact-compat",
- "react-dom": "preact-compat"
- } */
- },
-
- plugins: [new webpack.NamedModulesPlugin()]
-};
diff --git a/webpack.config.eslint.js b/webpack.config.eslint.js
deleted file mode 100644
index 8bf844242..000000000
--- a/webpack.config.eslint.js
+++ /dev/null
@@ -1,3 +0,0 @@
-require('babel-register');
-
-module.exports = require('./webpack.config.renderer.dev');
diff --git a/webpack.config.main.prod.js b/webpack.config.main.prod.js
deleted file mode 100644
index 18aec517f..000000000
--- a/webpack.config.main.prod.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Webpack config for production electron main process
- */
-
-import webpack from 'webpack';
-import merge from 'webpack-merge';
-import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
-import baseConfig from './webpack.config.base';
-
-export default merge.smart(baseConfig, {
- devtool: 'source-map',
-
- target: 'electron-main',
-
- entry: ['babel-polyfill', './app/main.dev'],
-
- // 'main.js' in root
- output: {
- path: __dirname,
- filename: './app/main.prod.js'
- },
-
- plugins: [
- new BundleAnalyzerPlugin({
- analyzerMode:
- process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
- openAnalyzer: process.env.OPEN_ANALYZER === 'true'
- }),
-
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- */
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'production'
- ),
- 'process.env.DEBUG_PROD': JSON.stringify(
- process.env.DEBUG_PROD || 'false'
- )
- })
- ],
-
- /**
- * Disables webpack processing of __dirname and __filename.
- * If you run the bundle in node.js it falls back to these values of node.js.
- * https://github.com/webpack/webpack/issues/2010
- */
- node: {
- __dirname: false,
- __filename: false
- }
-});
diff --git a/webpack.config.renderer.dev.dll.js b/webpack.config.renderer.dev.dll.js
deleted file mode 100644
index 53e3ded6d..000000000
--- a/webpack.config.renderer.dev.dll.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * Builds the DLL for development electron renderer process
- */
-
-import webpack from 'webpack';
-import path from 'path';
-import merge from 'webpack-merge';
-import baseConfig from './webpack.config.base';
-import { dependencies } from './package.json';
-
-const dist = path.resolve(process.cwd(), 'dll');
-
-export default merge.smart(baseConfig, {
- context: process.cwd(),
-
- devtool: 'eval',
-
- target: 'electron-renderer',
-
- externals: ['fsevents', 'crypto-browserify'],
-
- /**
- * @HACK: Copy and pasted from renderer dev config. Consider merging these
- * rules into the base config. May cause breaking changes.
- */
- module: {
- rules: [
- {
- test: /\.global\.css$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- {
- test: /^((?!\.global).)*\.css$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- sourceMap: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- }
- ]
- },
- // Add SASS support - compile all .global.scss files and pipe it to style.css
- {
- test: /\.global\.scss$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true
- }
- },
- {
- loader: 'sass-loader'
- }
- ]
- },
- // Add SASS support - compile all other .scss files and pipe it to style.css
- {
- test: /^((?!\.global).)*\.scss$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- sourceMap: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- },
- {
- loader: 'sass-loader'
- }
- ]
- },
- // Fonts
- {
- test: /\.(woff|woff2|eot|ttf)$/,
- use: [
- {
- loader: 'file-loader'
- }
- ]
- },
- // Text files
- {
- test: /\.(txt)$/,
- use: 'raw-loader'
- },
- // Common Image Formats
- {
- test: /\.(?:ico|gif|png|jpg|jpeg|webp|svg)$/,
- use: 'url-loader'
- }
- ]
- },
-
- resolve: {
- modules: ['app']
- },
-
- entry: {
- vendor: ['babel-polyfill', ...Object.keys(dependencies || {})].filter(
- dependency => dependency !== 'font-awesome'
- )
- },
-
- output: {
- library: 'vendor',
- path: dist,
- filename: '[name].dll.js',
- libraryTarget: 'var'
- },
-
- plugins: [
- new webpack.DllPlugin({
- path: path.join(dist, '[name].json'),
- name: '[name]'
- }),
-
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- */
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'development'
- )
- }),
-
- new webpack.LoaderOptionsPlugin({
- debug: true,
- options: {
- context: path.resolve(process.cwd(), 'app'),
- output: {
- path: path.resolve(process.cwd(), 'dll')
- }
- }
- })
- ]
-});
diff --git a/webpack.config.renderer.dev.js b/webpack.config.renderer.dev.js
deleted file mode 100644
index 1e18e6cb5..000000000
--- a/webpack.config.renderer.dev.js
+++ /dev/null
@@ -1,260 +0,0 @@
-/* eslint global-require: 0, import/no-dynamic-require: 0 */
-
-/**
- * Build config for development electron renderer process that uses
- * Hot-Module-Replacement
- *
- * https://webpack.js.org/concepts/hot-module-replacement/
- */
-
-import path from 'path';
-import fs from 'fs';
-import webpack from 'webpack';
-import chalk from 'chalk';
-import merge from 'webpack-merge';
-import { spawn, execSync } from 'child_process';
-import ExtractTextPlugin from 'extract-text-webpack-plugin';
-import baseConfig from './webpack.config.base';
-
-const port = process.env.PORT || 1212;
-const publicPath = `http://localhost:${port}/dist`;
-const dll = path.resolve(process.cwd(), 'dll');
-const manifest = path.resolve(dll, 'vendor.json');
-
-/**
- * Warn if the DLL is not built
- */
-if (!(fs.existsSync(dll) && fs.existsSync(manifest))) {
- console.log(
- chalk.black.bgYellow.bold(
- 'The DLL files are missing. Sit back while we build them for you with "npm run build-dll"'
- )
- );
- execSync('npm run build-dll');
-}
-
-export default merge.smart(baseConfig, {
- devtool: 'inline-source-map',
-
- target: 'electron-renderer',
-
- entry: [
- 'react-hot-loader/patch',
- `webpack-dev-server/client?http://localhost:${port}/`,
- 'webpack/hot/only-dev-server',
- path.join(__dirname, 'app/index.js')
- ],
-
- optimization: {
- // We no not want to minimize our code.
- minimize: false
- },
-
- output: {
- publicPath: `http://localhost:${port}/dist/`
- },
-
- /* externals: {
- 'pdfjs-dist': 'commonjs app/node_modules/@tagspaces/pro/libs/pdfjs-dist/build/pdf.min'
- }, */
-
- module: {
- rules: [
- {
- test: /\.global\.css$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- {
- test: /^((?!\.global).)*\.css$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- sourceMap: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- }
- ]
- },
- // Add SASS support - compile all .global.scss files and pipe it to style.css
- {
- test: /\.global\.scss$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true
- }
- },
- {
- loader: 'sass-loader'
- }
- ]
- },
- // Add SASS support - compile all other .scss files and pipe it to style.css
- {
- test: /^((?!\.global).)*\.scss$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- sourceMap: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- },
- {
- loader: 'sass-loader'
- }
- ]
- },
- // Add LESS support - compile all other .less files and pipe it to style.css
- {
- test: /\.less$/,
- use: [
- {
- loader: 'style-loader'
- },
- {
- loader: 'css-loader'
- },
- {
- loader: 'less-loader',
- options: {
- strictMath: true,
- noIeCompat: true
- }
- }
- ]
- },
- // Fonts
- {
- test: /\.(woff|woff2|eot|ttf)$/,
- use: [
- {
- loader: 'file-loader'
- }
- ]
- },
- // Text files
- {
- test: /\.(txt)$/,
- use: 'raw-loader'
- },
- // Common Image Formats
- {
- test: /\.(?:ico|gif|png|jpg|jpeg|webp|svg)$/,
- use: {
- loader: 'url-loader'
- /* options: {
- limit: 15000
- } */
- }
- }
- ]
- },
-
- plugins: [
- new webpack.DllReferencePlugin({
- context: process.cwd(),
- manifest: require(manifest),
- sourceType: 'var'
- }),
-
- /**
- * https://webpack.js.org/concepts/hot-module-replacement/
- */
- new webpack.HotModuleReplacementPlugin({
- // @TODO: Waiting on https://github.com/jantimon/html-webpack-plugin/issues/533
- // multiStep: true
- }),
-
- new webpack.NoEmitOnErrorsPlugin(),
-
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- *
- * By default, use 'development' as NODE_ENV. This can be overriden with
- * 'staging', for example, by changing the ENV variables in the npm scripts
- */
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'development'
- )
- }),
-
- new webpack.LoaderOptionsPlugin({
- debug: true
- }),
-
- new ExtractTextPlugin({
- filename: '[name].css'
- })
- ],
-
- node: {
- __dirname: false,
- __filename: false
- },
-
- devServer: {
- port,
- publicPath,
- compress: true,
- noInfo: true,
- stats: 'errors-only',
- inline: true,
- lazy: false,
- hot: true,
- headers: { 'Access-Control-Allow-Origin': '*' },
- contentBase: path.join(__dirname, 'dist'),
- watchOptions: {
- aggregateTimeout: 300,
- ignored: /node_modules/,
- poll: 100
- },
- historyApiFallback: {
- verbose: true,
- disableDotRule: false
- },
- before() {
- if (process.env.START_HOT) {
- spawn('npm', ['run', 'start-main-dev'], {
- shell: true,
- env: process.env,
- stdio: 'inherit'
- })
- .on('close', code => process.exit(code))
- .on('error', spawnError => console.error(spawnError));
- }
- }
- }
-});
diff --git a/webpack.config.renderer.prod.js b/webpack.config.renderer.prod.js
deleted file mode 100644
index 251b1e841..000000000
--- a/webpack.config.renderer.prod.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * Build config for electron renderer process
- */
-
-import path from 'path';
-import webpack from 'webpack';
-import MiniCssExtractPlugin from 'mini-css-extract-plugin';
-import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
-import merge from 'webpack-merge';
-import baseConfig from './webpack.config.base';
-
-export default merge.smart(baseConfig, {
- devtool: 'source-map',
-
- target: 'electron-renderer',
-
- entry: ['babel-polyfill', './app/index'],
-
- output: {
- path: path.join(__dirname, 'app/dist'),
- publicPath: './dist/'
- },
-
- /* externals: {
- 'pdfjs-dist': 'commonjs app/node_modules/@tagspaces/pro/libs/pdfjs-dist/build/pdf.min'
- }, */
-
- module: {
- rules: [
- // Extract all .global.css to style.css as is
- {
- test: /\.global\.css$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader,
- options: {
- publicPath: './'
- }
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- // Pipe other styles through css modules and append to style.css
- {
- test: /^((?!\.global).)*\.css$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- localIdentName: '[name]__[local]__[hash:base64:5]',
- sourceMap: true
- }
- }
- ]
- },
- // Add SASS support - compile all .global.scss files and pipe it to style.css
- {
- test: /\.global\.(scss|sass)$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true,
- importLoaders: 1
- }
- },
- {
- loader: 'sass-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- // Add SASS support - compile all other .scss files and pipe it to style.css
- {
- test: /^((?!\.global).)*\.(scss|sass)$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]',
- sourceMap: true
- }
- },
- {
- loader: 'sass-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- // Fonts
- {
- test: /\.(woff|woff2|eot|ttf)$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- publicPath: '../dist/'
- }
- }
- ]
- },
- // Text files
- {
- test: /\.(txt)$/,
- use: 'raw-loader'
- },
- // Common Image Formats
- {
- test: /\.(?:ico|gif|png|jpg|jpeg|webp)$/,
- use: {
- loader: 'url-loader',
- options: {
- limit: 15000
- }
- }
- },
- {
- test: /\.(?:svg)$/,
- use: 'url-loader'
- }
- ]
- },
-
- plugins: [
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- */
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'production'
- )
- }),
-
- new MiniCssExtractPlugin({
- filename: 'style.css'
- }),
-
- new BundleAnalyzerPlugin({
- analyzerMode:
- process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
- openAnalyzer: process.env.OPEN_ANALYZER === 'true'
- })
- ]
-});
diff --git a/webpack.config.renderer.web.js b/webpack.config.renderer.web.js
deleted file mode 100644
index cd372613d..000000000
--- a/webpack.config.renderer.web.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * Build config for electron renderer process
- */
-
-import path from 'path';
-import webpack from 'webpack';
-import MiniCssExtractPlugin from 'mini-css-extract-plugin';
-import merge from 'webpack-merge';
-import baseConfig from './webpack.config.base';
-
-export default merge.smart(baseConfig, {
- devtool: 'source-map',
-
- target: 'web',
-
- entry: ['babel-polyfill', './app/index'],
-
- output: {
- libraryTarget: 'window', // 'commonjs2',
- path: path.join(__dirname, 'web/dist'),
- publicPath: './dist/'
- },
-
- optimization: {
- // We no not want to minimize our code. TODO remove this for production
- minimize: true
- },
-
- node: {
- fs: 'empty',
- child_process: 'empty'
- },
-
- module: {
- rules: [
- // Extract all .global.css to style.css as is
- {
- test: /\.global\.css$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader,
- options: {
- publicPath: './'
- }
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- // Pipe other styles through css modules and append to style.css
- {
- test: /^((?!\.global).)*\.css$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- localIdentName: '[name]__[local]__[hash:base64:5]',
- sourceMap: true
- }
- }
- ]
- },
- // Add SASS support - compile all .global.scss files and pipe it to style.css
- {
- test: /\.global\.(scss|sass)$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader
- },
- {
- loader: 'css-loader',
- options: {
- sourceMap: true,
- importLoaders: 1
- }
- },
- {
- loader: 'sass-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- // Add SASS support - compile all other .scss files and pipe it to style.css
- {
- test: /^((?!\.global).)*\.(scss|sass)$/,
- use: [
- {
- loader: MiniCssExtractPlugin.loader
- },
- {
- loader: 'css-loader',
- options: {
- modules: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]',
- sourceMap: true
- }
- },
- {
- loader: 'sass-loader',
- options: {
- sourceMap: true
- }
- }
- ]
- },
- // Fonts
- {
- test: /\.(woff|woff2|eot|ttf)$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- // name: '[name].[ext]',
- publicPath: '../dist/'
- }
- }
- ]
- },
- // Text files
- {
- test: /\.(txt)$/,
- use: 'raw-loader'
- },
- // Common Image Formats
- {
- test: /\.(?:ico|gif|png|jpg|jpeg|webp|svg)$/,
- use: 'url-loader'
- }
- ]
- },
-
- plugins: [
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- */
- new webpack.DefinePlugin({
- // evtl make process.env.NODE_ENV false for cordova and web
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'production'
- )
- }),
-
- new webpack.IgnorePlugin(/electron-io/),
-
- new MiniCssExtractPlugin({
- filename: 'style.css'
- })
- ]
-});
diff --git a/webpack.config.worker.dev.js b/webpack.config.worker.dev.js
deleted file mode 100644
index 11b0e1f41..000000000
--- a/webpack.config.worker.dev.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * Build config for electron renderer process
- */
-
-import path from 'path';
-import webpack from 'webpack';
-import ExtractTextPlugin from 'extract-text-webpack-plugin';
-import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
-import merge from 'webpack-merge';
-import baseConfig from './webpack.config.base';
-
-export default merge.smart(baseConfig, {
- devtool: 'source-map',
-
- target: 'electron-renderer',
-
- entry: ['./app/splash-worker.js'],
-
- optimization: {
- // We no not want to minimize our code.
- minimize: false
- },
-
- output: {
- filename: 'electron-worker.js',
- path: path.join(__dirname, 'app/dist'),
- publicPath: './dist/'
- },
-
- /* externals: {
- 'pdfjs-dist': 'commonjs app/node_modules/@tagspaces/pro/libs/pdfjs-dist/build/pdf.min'
- }, */
-
- module: {
- rules: [
- // Extract all .global.css to style.css as is
- {
- test: /\.global\.css$/,
- use: ExtractTextPlugin.extract({
- use: 'css-loader',
- fallback: 'style-loader'
- })
- },
- // Pipe other styles through css modules and append to style.css
- {
- test: /^((?!\.global).)*\.css$/,
- use: ExtractTextPlugin.extract({
- use: {
- loader: 'css-loader',
- options: {
- modules: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- }
- })
- },
- // Add SASS support - compile all .global.scss files and pipe it to style.css
- {
- test: /\.global\.scss$/,
- use: ExtractTextPlugin.extract({
- use: [
- {
- loader: 'css-loader'
- },
- {
- loader: 'sass-loader'
- }
- ],
- fallback: 'style-loader'
- })
- },
- // Add SASS support - compile all other .scss files and pipe it to style.css
- {
- test: /^((?!\.global).)*\.scss$/,
- use: ExtractTextPlugin.extract({
- use: [
- {
- loader: 'css-loader',
- options: {
- modules: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- },
- {
- loader: 'sass-loader'
- }
- ]
- })
- },
- // Add LESS support - compile all other .less files and pipe it to style.css
- {
- test: /\.less$/,
- use: ExtractTextPlugin.extract({
- use: [
- {
- loader: 'css-loader'
- },
- {
- loader: 'less-loader'
- }
- ],
- // use style-loader in development
- fallback: 'style-loader'
- })
- },
- // Fonts
- {
- test: /\.(woff|woff2|eot|ttf)$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- publicPath: '../dist/'
- }
- }
- ]
- },
- // Text files
- {
- test: /\.(txt)$/,
- use: 'raw-loader'
- },
- // Common Image Formats
- {
- test: /\.(?:ico|gif|png|jpg|jpeg|webp)$/,
- use: {
- loader: 'url-loader'
- /* options: {
- limit: 15000
- } */
- }
- },
- {
- test: /\.(?:svg)$/,
- use: 'url-loader'
- }
- ]
- },
-
- plugins: [
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- */
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'production'
- )
- }),
-
- new ExtractTextPlugin('style.css'),
-
- new BundleAnalyzerPlugin({
- analyzerMode:
- process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
- openAnalyzer: process.env.OPEN_ANALYZER === 'true'
- })
- ]
-});
diff --git a/webpack.config.worker.prod.js b/webpack.config.worker.prod.js
deleted file mode 100644
index add23e324..000000000
--- a/webpack.config.worker.prod.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Build config for electron renderer process
- */
-
-import path from 'path';
-import webpack from 'webpack';
-import ExtractTextPlugin from 'extract-text-webpack-plugin';
-import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
-import merge from 'webpack-merge';
-import baseConfig from './webpack.config.base';
-
-export default merge.smart(baseConfig, {
- devtool: 'source-map',
-
- target: 'electron-renderer',
-
- entry: ['./app/splash-worker.js'],
-
- output: {
- filename: 'electron-worker.js',
- path: path.join(__dirname, 'app/dist'),
- publicPath: './dist/'
- },
-
- /* externals: {
- 'pdfjs-dist': 'commonjs app/node_modules/@tagspaces/pro/libs/pdfjs-dist/build/pdf.min'
- }, */
-
- module: {
- rules: [
- // Extract all .global.css to style.css as is
- {
- test: /\.global\.css$/,
- use: ExtractTextPlugin.extract({
- use: 'css-loader',
- fallback: 'style-loader'
- })
- },
- // Pipe other styles through css modules and append to style.css
- {
- test: /^((?!\.global).)*\.css$/,
- use: ExtractTextPlugin.extract({
- use: {
- loader: 'css-loader',
- options: {
- modules: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- }
- })
- },
- // Add SASS support - compile all .global.scss files and pipe it to style.css
- {
- test: /\.global\.scss$/,
- use: ExtractTextPlugin.extract({
- use: [
- {
- loader: 'css-loader'
- },
- {
- loader: 'sass-loader'
- }
- ],
- fallback: 'style-loader'
- })
- },
- // Add SASS support - compile all other .scss files and pipe it to style.css
- {
- test: /^((?!\.global).)*\.scss$/,
- use: ExtractTextPlugin.extract({
- use: [
- {
- loader: 'css-loader',
- options: {
- modules: true,
- importLoaders: 1,
- localIdentName: '[name]__[local]__[hash:base64:5]'
- }
- },
- {
- loader: 'sass-loader'
- }
- ]
- })
- },
- // Add LESS support - compile all other .less files and pipe it to style.css
- {
- test: /\.less$/,
- use: ExtractTextPlugin.extract({
- use: [
- {
- loader: 'css-loader'
- },
- {
- loader: 'less-loader'
- }
- ],
- // use style-loader in development
- fallback: 'style-loader'
- })
- },
- // Fonts
- {
- test: /\.(woff|woff2|eot|ttf)$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- publicPath: '../dist/'
- }
- }
- ]
- },
- // Text files
- {
- test: /\.(txt)$/,
- use: 'raw-loader'
- },
- // Common Image Formats
- {
- test: /\.(?:ico|gif|png|jpg|jpeg|webp)$/,
- use: {
- loader: 'url-loader'
- /* options: {
- limit: 15000
- } */
- }
- },
- {
- test: /\.(?:svg)$/,
- use: 'url-loader'
- }
- ]
- },
-
- plugins: [
- /**
- * Create global constants which can be configured at compile time.
- *
- * Useful for allowing different behaviour between development builds and
- * release builds
- *
- * NODE_ENV should be production so that modules do not perform certain
- * development checks
- */
- new webpack.DefinePlugin({
- 'process.env.NODE_ENV': JSON.stringify(
- process.env.NODE_ENV || 'production'
- )
- }),
-
- new ExtractTextPlugin('style.css'),
-
- new BundleAnalyzerPlugin({
- analyzerMode:
- process.env.OPEN_ANALYZER === 'true' ? 'server' : 'disabled',
- openAnalyzer: process.env.OPEN_ANALYZER === 'true'
- })
- ]
-});