UNPKG

testpub-ssr

Version:

Test Pub SSR

59 lines (52 loc) 1.47 kB
const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const PrettierPlugin = require('prettier-webpack-plugin'); const ESLintPlugin = require('eslint-webpack-plugin'); const paths = require('./paths'); const path = require('path'); module.exports = { // entry: ['./index.tsx'], output: { path: paths.build, filename: '[name].bundle.js', publicPath: '/', }, plugins: [ new CleanWebpackPlugin(), new CopyWebpackPlugin({ patterns: [ { from: paths.public, to: 'assets', globOptions: { ignore: ['*.DS_Store'], }, noErrorOnMissing: true, }, ], }), new ESLintPlugin({ files: ['src'], formatter: 'table', }), new PrettierPlugin(), ], module: { rules: [ { test: /\.tsx?$/, loader: 'ts-loader' }, { test: /\.(?:ico|gif|png|jpg|jpeg)$/i, type: 'asset/resource' }, { test: /\.(woff(2)?|eot|ttf|otf|svg|)$/, type: 'asset/inline' }, ], }, resolve: { modules: [paths.src, 'node_modules'], extensions: ['.tsx', '.ts', '.js', '.jsx', '.json'], alias: { '@': paths.src, Components: path.resolve(__dirname, '../src/components/'), Types: path.resolve(__dirname, '../src/types/'), Utils: path.resolve(__dirname, '../src/utils/'), Assets: path.resolve(__dirname, '../src/assets/'), }, }, };