copy over css/fonts folder

This commit is contained in:
Vu Nguyen
2021-01-15 20:30:48 -06:00
parent faf2727b51
commit 2e4d917e33
3 changed files with 117 additions and 4 deletions

View File

@@ -1,12 +1,17 @@
import * as path from 'path';
/* eslint-disable @typescript-eslint/no-unsafe-call */
import { join } from 'path';
import * as webpack from 'webpack';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
const publicFolder = join(__dirname, 'public');
const cssFolder = join(publicFolder, 'css');
const fontFolder = join(publicFolder, 'fonts');
export default (): webpack.Configuration[] => {
const cfgs: webpack.Configuration[] = [];
const chromeExtCfg: webpack.Configuration = {
entry: {
app: [path.join(__dirname, 'src', 'app.tsx')],
app: [join(__dirname, 'src', 'app.tsx')],
},
module: {
rules: [
@@ -18,9 +23,17 @@ export default (): webpack.Configuration[] => {
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'dist', 'chrome'),
path: join(__dirname, 'dist', 'chrome'),
},
plugins: [new CleanWebpackPlugin()],
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [
{ from: cssFolder, to: 'public/css' },
{ from: fontFolder, to: 'public/fonts' },
],
}),
],
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},