moving front app to subfolder. add webpack config with watch and dev-server mode. moving deploy things in subfolder
This commit is contained in:
committed by
Daniel Hutzel
parent
0e86e1e1fd
commit
dbe4b8a7bd
33
media-store/app-src/webpack/common-plugins.js
Normal file
33
media-store/app-src/webpack/common-plugins.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
template: path.join(__dirname, '../public/index.html'),
|
||||
filename: path.join(__dirname, '../../app/index.html'),
|
||||
publicPath: '/static/', // for js bundles path
|
||||
}),
|
||||
new InterpolateHtmlPlugin(HtmlWebpackPlugin, {
|
||||
PUBLIC_URL: '',
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.join(__dirname, '../public'),
|
||||
to: path.join(__dirname, '../../app'),
|
||||
globOptions: {
|
||||
dot: true,
|
||||
ignore: ['**/index.html'],
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
new webpack.ProgressPlugin(),
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user