Skip to content

Commit

Permalink
Backport PR #15299: Declare Webpack loaders with require.resolve() (#…
Browse files Browse the repository at this point in the history
…15307)

Co-authored-by: Thibault Derousseaux <6574550+tibdex@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and tibdex committed Oct 26, 2023
1 parent 0019648 commit 9cb7672
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion builder/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export namespace Build {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
use: [MiniCssExtractPlugin.loader, require.resolve('css-loader')]
},
{
test: /\.svg/,
Expand Down
2 changes: 1 addition & 1 deletion builder/src/extensionConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function generateConfig({
rules.push({
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader']
use: [require.resolve('source-map-loader')]
});
}

Expand Down
5 changes: 4 additions & 1 deletion builder/src/webpack.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import miniSVGDataURI from 'mini-svg-data-uri';

const rules = [
{ test: /\.raw\.css$/, type: 'asset/source' },
{ test: /(?<!\.raw)\.css$/, use: ['style-loader', 'css-loader'] },
{
test: /(?<!\.raw)\.css$/,
use: [require.resolve('style-loader'), require.resolve('css-loader')]
},
{ test: /\.txt$/, type: 'asset/source' },
{ test: /\.md$/, type: 'asset/source' },
{ test: /\.(jpg|png|gif)$/, type: 'asset/resource' },
Expand Down

0 comments on commit 9cb7672

Please sign in to comment.