Resolve viewer's modules
This commit is contained in:
parent
f5d6674b62
commit
35dc82e120
@ -7,17 +7,21 @@ const ExtractCssChunks = require('extract-css-chunks-webpack-plugin');
|
|||||||
const SRC_DIR = path.join(__dirname, '../src');
|
const SRC_DIR = path.join(__dirname, '../src');
|
||||||
const PUBLIC_DIR = path.join(__dirname, '../public');
|
const PUBLIC_DIR = path.join(__dirname, '../public');
|
||||||
const DIST_DIR = path.join(__dirname, '../dist');
|
const DIST_DIR = path.join(__dirname, '../dist');
|
||||||
// console.log(process);
|
|
||||||
|
|
||||||
module.exports = (env, argv) => {
|
module.exports = (env, argv) => {
|
||||||
// console.log(env);
|
|
||||||
// console.log(argv);
|
|
||||||
return {
|
return {
|
||||||
entry: {
|
entry: {
|
||||||
app: `${SRC_DIR}/index.js`,
|
app: `${SRC_DIR}/index.js`,
|
||||||
},
|
},
|
||||||
context: SRC_DIR,
|
context: SRC_DIR,
|
||||||
resolve: {
|
resolve: {
|
||||||
|
modules: [
|
||||||
|
// Modules specific to this package
|
||||||
|
path.resolve(__dirname, '../node_modules'),
|
||||||
|
// Hoisted Yarn Workspace Modules
|
||||||
|
path.resolve(__dirname, '../../../node_modules'),
|
||||||
|
SRC_DIR,
|
||||||
|
],
|
||||||
extensions: ['.js', '.jsx', '.json', '*'],
|
extensions: ['.js', '.jsx', '.json', '*'],
|
||||||
symlinks: true,
|
symlinks: true,
|
||||||
},
|
},
|
||||||
@ -78,6 +82,10 @@ module.exports = (env, argv) => {
|
|||||||
chunkFilename: '[id].css',
|
chunkFilename: '[id].css',
|
||||||
// hot: true /* only necessary if hot reloading not function*/
|
// hot: true /* only necessary if hot reloading not function*/
|
||||||
}),
|
}),
|
||||||
|
/**
|
||||||
|
* This generates our index.html file from the specified template.
|
||||||
|
* This is the easiest way to inject custom configuration and extensions.
|
||||||
|
*/
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: `${PUBLIC_DIR}/index.html`,
|
template: `${PUBLIC_DIR}/index.html`,
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user