1 const webpack = require('webpack');
2 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 const nodeExternals = require('webpack-node-externals');
4 const CopyPlugin = require('copy-webpack-plugin');
5 const { merge } = require('lodash');
8 hash:[contentHash], chunkhash:[chunkhash], name:[name], filebase:[base], query:[query], file:[file]
9 Source code: https://github.com/LemmyNet/lemmy-ui
11 @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL v3.0
16 filename: 'js/server.js',
20 extensions: ['.js', '.jsx', '.ts', '.tsx'],
28 test: /\.(scss|css)$/i,
29 use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
32 test: /\.(js|jsx|tsx|ts)$/, // All ts and tsx files will be process by
33 exclude: /node_modules/, // ignore node_modules
34 loader: 'babel-loader',
36 // Due to some weird babel issue: https://github.com/webpack/webpack/issues/11467
40 fullySpecified: false,
46 new MiniCssExtractPlugin({
47 filename: 'styles/styles.css',
50 patterns: [{ from: './src/assets', to: './assets' }],
52 new webpack.BannerPlugin({
58 const createServerConfig = (env, mode) => {
59 const config = merge({}, base, {
61 entry: './src/server/index.tsx',
63 filename: 'js/server.js',
66 externals: [nodeExternals(), 'inferno-helmet'],
69 if (mode === 'development') {
78 const createClientConfig = (env, mode) => {
79 const config = merge({}, base, {
81 entry: './src/client/index.tsx',
83 filename: 'js/client.js',
87 if (mode === 'development') {
97 module.exports = (env, properties) => [
98 createServerConfig(env, properties.mode || 'development'),
99 createClientConfig(env, properties.mode || 'development'),