client: webpack: process file assets with allowed file extension list

This commit is contained in:
Jesse Chan
2020-10-20 16:45:44 +08:00
parent 90fc029781
commit 7e5182a04a
2 changed files with 4 additions and 26 deletions
+2 -13
View File
@@ -108,18 +108,7 @@ module.exports = {
],
},
{
exclude: [
/\.html$/,
/\.(js|jsx|ts|tsx)$/,
/\.css$/,
/\.scss$/,
/\.json$/,
/\.bmp$/,
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.svg$/,
],
test: [/\.md$/, /\.eot$/, /\.ttf$/, /\.woff$/, /\.woff2$/],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
@@ -148,7 +137,7 @@ module.exports = {
},
entry: paths.appIndex,
resolve: {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx', '.json'],
extensions: ['.cjs', '.mjs', '.js', '.jsx', '.ts', '.tsx', '.json'],
alias: {
'@shared': path.resolve('./shared'),
},
+2 -13
View File
@@ -104,18 +104,7 @@ module.exports = {
],
},
{
exclude: [
/\.html$/,
/\.(js|jsx|ts|tsx)$/,
/\.css$/,
/\.scss$/,
/\.json$/,
/\.bmp$/,
/\.gif$/,
/\.jpe?g$/,
/\.png$/,
/\.svg$/,
],
test: [/\.md$/, /\.eot$/, /\.ttf$/, /\.woff$/, /\.woff2$/],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
@@ -144,7 +133,7 @@ module.exports = {
},
entry: paths.appIndex,
resolve: {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx', '.json'],
extensions: ['.cjs', '.mjs', '.js', '.jsx', '.ts', '.tsx', '.json'],
alias: {
'react-intl': 'react-intl/react-intl-no-parser.umd.min.js',
'@shared': path.resolve('./shared'),