Skip to content

Commit

Permalink
fix: webpack path
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagofeijor committed May 22, 2024
1 parent 1e052ea commit f967661
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 139 deletions.
32 changes: 14 additions & 18 deletions .config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ const webpack = require('webpack');

module.exports = {
entry: path.resolve(process.cwd(), 'src/index.js'),
output: {
publicPath: '/',
},
resolve: {
extensions: ['.js', '.jsx'],
},
optimization: {
splitChunks: {
chunks: 'all',
},
},
plugins: [
new webpack.ProgressPlugin(),
],
module: {
rules: [
{
Expand Down Expand Up @@ -34,22 +48,4 @@ module.exports = {
},
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
output: {
publicPath: '/',
},
plugins: [
new webpack.ProgressPlugin({
activeModules: false,
entries: true,
modules: true,
modulesCount: 5000,
profile: false,
dependencies: true,
dependenciesCount: 10000,
percentBy: null,
}),
],
}
4 changes: 2 additions & 2 deletions .config/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module.exports = merge({
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(process.cwd(), 'public/index.html'),
template: path.join(process.cwd(), '.config/public/index.html'),
filename: path.join(process.cwd(), 'build/index.html'),
}),
],
devServer: {
port: 3001,
static: path.join(process.cwd(), 'public'),
static: path.join(process.cwd(), '.config/public'),
historyApiFallback: true,
host: '0.0.0.0',
},
Expand Down
11 changes: 3 additions & 8 deletions .config/webpack/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,17 @@ module.exports = merge(common, {
filename: 'static/[name].[contenthash].js',
path: path.resolve(process.cwd(), 'docs'),
},
optimization: {
splitChunks: {
chunks: 'all',
},
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(process.cwd(), 'public/index.html'),
template: path.join(process.cwd(), '.config/public/index.html'),
filename: path.join(process.cwd(), 'docs/index.html'),
}),
new FaviconsWebpackPlugin({
logo: './public/logo.png',
logo: path.join(process.cwd(), '.config/public/logo.png'),
cache: true,
inject: true,
mode: 'webapp',
manifest: './public/manifest.json',
manifest: path.join(process.cwd(), '.config/public/manifest.json'),
}),
new WebpackAssetsManifest({}),
new WorkboxPlugin.GenerateSW()
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import { createRoot } from 'react-dom/client';
import App from './App';
import './index.css'

const container = document.getElementById('root');
const root = createRoot(container);
Expand Down
55 changes: 0 additions & 55 deletions webpack/webpack.common.js

This file was deleted.

24 changes: 0 additions & 24 deletions webpack/webpack.dev.js

This file was deleted.

31 changes: 0 additions & 31 deletions webpack/webpack.prod.js

This file was deleted.

0 comments on commit f967661

Please sign in to comment.