New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial updates for webpack 5 support #101
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
284b4d7
Remove tar dependency
brophdawg11 4c30597
Add some missing deps (vuex,vue-router,memory-fs)
brophdawg11 3ff71a3
Update webpack to v5 and update webpack deps to latest
brophdawg11 f57231f
Add patch-package and vue-server-renderer patch
brophdawg11 77d5f61
Remove resolve, initialStateMetaTag, and some logging
brophdawg11 4f5371f
Remove patches directory, must be handled from parent repo
brophdawg11 c6df06f
Update output.libraryTarget -> output.library.type
brophdawg11 d37c241
Move base devtool config to client build
brophdawg11 b0f12fd
Update webpack-dev-middleware to latest
brophdawg11 93058c6
Update HMR for webpack 5
brophdawg11 1ee302d
Remove patch-package
brophdawg11 8e3743c
Update vue/vue-server-renderer/vue-template-compiler to 2.6.14
brophdawg11 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const path = require('path'); | ||
|
||
const webpack = require('webpack'); | ||
const VueLoaderPlugin = require('vue-loader/lib/plugin'); | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
|
@@ -10,14 +8,11 @@ const isLocal = process.env.NODE_ENV === 'local'; | |
const isProd = process.env.NODE_ENV === 'production'; | ||
const isDev = !isLocal && !isProd; | ||
const logLevel = process.env.LOG_LEVEL || 'debug'; | ||
const environment = isProd ? 'production' : 'development'; | ||
const nodeEnv = isProd ? 'production' : 'development'; | ||
|
||
console.log(`process.env.NODE_ENV: ${process.env.NODE_ENV}`); | ||
console.log(`Webpack building for environment: ${environment}`); | ||
console.log(`Webpack building for NODE_ENV: ${nodeEnv}`); | ||
|
||
function getCssLoaders(config) { | ||
console.log(`Enable PostCSS: ${config.enablePostCss}`); | ||
|
||
const addlLoaders = [ | ||
...(config.enablePostCss ? [{ | ||
loader: 'postcss-loader', | ||
|
@@ -71,26 +66,12 @@ module.exports = { | |
logLevel, | ||
getBaseConfig(config) { | ||
return { | ||
mode: environment, | ||
devtool: isProd ? 'source-map' : 'eval-source-map', | ||
mode: nodeEnv, | ||
output: { | ||
publicPath: '/dist/', | ||
filename: isProd ? '[name].[chunkhash].js' : '[name].js', | ||
chunkFilename: isProd ? '_[name].[chunkhash].js' : '_[name].js', | ||
}, | ||
resolve: { | ||
alias: { | ||
'@components': path.resolve(config.rootDir, 'src/components'), | ||
'@dist': path.resolve(config.rootDir, 'dist'), | ||
'@js': path.resolve(config.rootDir, 'src/js'), | ||
'@scss': path.resolve(config.rootDir, 'src/scss'), | ||
'@server': path.resolve(config.rootDir, 'src/server'), | ||
'@src': path.resolve(config.rootDir, 'src'), | ||
'@static': path.resolve(config.rootDir, 'static'), | ||
'@store': path.resolve(config.rootDir, 'src/store'), | ||
}, | ||
extensions: ['*', '.js', '.vue', '.json'], | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change - no longer providing anything out of the box here - this configuration is left up to the consuming application build |
||
module: { | ||
rules: [ | ||
{ | ||
|
@@ -160,7 +141,7 @@ module.exports = { | |
resourceQuery: /inline/, | ||
use: { | ||
loader: 'svg-inline-loader', | ||
options: config.svgInlineLoaderOptions, | ||
options: config.svgInlineLoaderOptions || {}, | ||
}, | ||
}, { | ||
resourceQuery: /http/, | ||
|
@@ -186,7 +167,7 @@ module.exports = { | |
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV), | ||
'process.env.NODE_ENV': JSON.stringify(nodeEnv), | ||
}), | ||
new VueLoaderPlugin(), | ||
...(config.extractCss ? [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to the client build so we don't have to turn it off for server builds