copy books to build dir

This commit is contained in:
Alfred Melch 2020-03-13 12:00:29 +01:00
parent c2379ff768
commit 60f92904cc

View File

@ -1,5 +1,6 @@
const path = require('path') const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
@ -58,8 +59,9 @@ module.exports = (env, argv) => {
name: entrypoint => `runtime-${entrypoint.name}` name: entrypoint => `runtime-${entrypoint.name}`
} }
}, },
resolve: { modules: ['src', 'lib', 'node_modules'] }, resolve: { modules: ['src', 'node_modules'] },
plugins: [ plugins: [
new CopyPlugin([{ from: 'books', to: 'books' }]),
// creat an index.html // creat an index.html
new HtmlWebpackPlugin(), new HtmlWebpackPlugin(),
// show a progress bar // show a progress bar