Skip to content

Commit f4fbdf3

Browse files
authored
Merge pull request #59 from jsor-labs/update-frontend-dependencies
Update frontend dependencies to their latest versions
2 parents 4c3e9c2 + bc620a0 commit f4fbdf3

33 files changed

+12664
-7040
lines changed

bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if ($input->hasParameterOption('--dev-server')) {
7373
'127.0.0.1:8000'
7474
);
7575

76-
putenv('DEPLOY_URL=' . $address);
76+
putenv('DEPLOY_URL=http://' . $address);
7777

7878
call_user_func(
7979
$container['server'],

config/webpack-dev-server.config.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = {
2929
'@babel/preset-env',
3030
{
3131
useBuiltIns: 'entry',
32+
corejs: 3,
3233
modules: false,
3334
debug: false,
3435
}
@@ -54,38 +55,36 @@ module.exports = {
5455
{
5556
loader: 'postcss-loader',
5657
options: {
57-
plugins: [
58-
require('postcss-import')(),
59-
require('postcss-flexbugs-fixes')(),
60-
require('postcss-preset-env')({
61-
stage: 0,
62-
autoprefixer: {
63-
flexbox: 'no-2009',
64-
grid: true,
65-
}
66-
}),
67-
]
58+
postcssOptions: {
59+
plugins: [
60+
require('postcss-import')(),
61+
require('postcss-flexbugs-fixes')(),
62+
require('postcss-preset-env')({
63+
stage: 0,
64+
autoprefixer: {
65+
flexbox: 'no-2009',
66+
grid: true,
67+
}
68+
}),
69+
]
70+
}
6871
}
6972
}
7073
],
7174
},
7275
{
7376
test: /\.(gif|png|jpe?g|svg)$/i,
74-
use: [
75-
'file-loader',
76-
],
77+
type: 'asset/resource',
7778
},
7879
{
7980
test: /\.(woff|woff2|eot|ttf|otf)$/,
80-
use: [
81-
'file-loader',
82-
],
81+
type: 'asset/resource',
8382
},
8483
],
8584
},
8685
devtool: 'eval',
8786
devServer: {
88-
publicPath: 'http://localhost:8080/_assets/',
87+
static: './static-files/',
8988
headers: {
9089
'Access-Control-Allow-Origin': '*'
9190
}

config/webpack.config.js

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
const path = require('path');
2-
const webpack = require('webpack');
32
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
43
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
54
const PostCSSAssetsPlugin = require('postcss-assets-webpack-plugin');
6-
const ManifestPlugin = require('webpack-manifest-plugin');
5+
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
76

87
module.exports = () => {
98
const mode = 'production';
@@ -19,8 +18,10 @@ module.exports = () => {
1918
},
2019
output: {
2120
path: path.resolve(process.cwd(), targetPath),
21+
publicPath: '', // see https://github.com/shellscape/webpack-manifest-plugin/issues/229#issuecomment-737617994
2222
filename: '[name].[contenthash:8].js',
2323
chunkFilename: '[name].[contenthash:8].js',
24+
assetModuleFilename: '[name].[contenthash:8][ext][query]'
2425
},
2526
optimization: {
2627
runtimeChunk: 'single'
@@ -70,49 +71,35 @@ module.exports = () => {
7071
{
7172
loader: 'postcss-loader',
7273
options: {
73-
plugins: [
74-
require('postcss-import')(),
75-
require('postcss-flexbugs-fixes')(),
76-
require('postcss-preset-env')({
77-
stage: 0,
78-
autoprefixer: {
79-
flexbox: 'no-2009',
80-
grid: true,
81-
}
82-
}),
83-
]
74+
postcssOptions: {
75+
plugins: [
76+
require('postcss-import')(),
77+
require('postcss-flexbugs-fixes')(),
78+
require('postcss-preset-env')({
79+
stage: 0,
80+
autoprefixer: {
81+
flexbox: 'no-2009',
82+
grid: true,
83+
}
84+
}),
85+
]
86+
}
8487
}
8588
}
8689
],
8790
},
8891
{
8992
test: /\.(gif|png|jpe?g|svg)$/i,
90-
use: [
91-
{
92-
loader: 'file-loader',
93-
options: {
94-
name: '[name].[hash:8].[ext]',
95-
}
96-
},
97-
],
93+
type: 'asset/resource',
9894
},
9995
{
10096
test: /\.(woff|woff2|eot|ttf|otf)$/,
101-
use: [
102-
{
103-
loader: 'file-loader',
104-
options: {
105-
name: '[name].[hash:8].[ext]',
106-
}
107-
},
108-
],
97+
type: 'asset/resource',
10998
},
11099
],
111100
},
112101
plugins: [
113102
new CleanWebpackPlugin(),
114-
// https://webpack.js.org/guides/caching/#module-identifiers
115-
new webpack.HashedModuleIdsPlugin(),
116103
new MiniCssExtractPlugin({
117104
filename: '[name].[contenthash:8].css',
118105
chunkFilename: '[name].[contenthash:8].css',
@@ -128,7 +115,7 @@ module.exports = () => {
128115
}),
129116
],
130117
}),
131-
new ManifestPlugin(),
118+
new WebpackManifestPlugin({}),
132119
]
133120
};
134121
};

0 commit comments

Comments
 (0)