Skip to content
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

feat: remove extended resolve extensions #5184

Merged
merged 7 commits into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions crates/rspack_testing/src/eval_raw.rs
Original file line number Diff line number Diff line change
@@ -28,12 +28,7 @@ config.output ??= {{}};
config.output.path ??= "{test_dir}/dist";
const normalized = rspack.config.getNormalizedRspackOptions(config);
rspack.config.applyRspackOptionsDefaults(normalized);
let fakeCompiler = {{
ruleSet: {{
references: new Map()
}}
}};
const raw = rspack.config.__internal__getRawOptions(normalized, fakeCompiler);
const raw = rspack.getRawOptions(normalized);
JSON.stringify(raw, null, 2)
"#
)
3 changes: 2 additions & 1 deletion diffcases/arco-pro/rspack.config.js
Original file line number Diff line number Diff line change
@@ -81,7 +81,8 @@ const config = {
// See also <https://github.com/search?q=repo%3Aswc-project%2Fswc+parser+stack+overflow&type=issues>
mockjs: require.resolve("./patches/mock.js"),
"@swc/helpers": require.resolve("@swc/helpers")
}
},
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
output: {
publicPath: "/",
3 changes: 2 additions & 1 deletion examples/arco-pro/rspack.config.js
Original file line number Diff line number Diff line change
@@ -88,7 +88,8 @@ const config = {
// Alias to the unminified version mitigates this problem.
// See also <https://github.com/search?q=repo%3Aswc-project%2Fswc+parser+stack+overflow&type=issues>
mockjs: require.resolve("./patches/mock.js")
}
},
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
output: {
publicPath: "/",
3 changes: 2 additions & 1 deletion examples/basic-ts/rspack.config.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ const rspack = require("@rspack/core");
const config = {
entry: "./src/index.ts",
resolve: {
tsConfigPath: path.resolve(__dirname, "tsconfig.json")
tsConfigPath: path.resolve(__dirname, "tsconfig.json"),
extensions: ["...", ".ts"]
},
plugins: [
new rspack.HtmlRspackPlugin({
5 changes: 4 additions & 1 deletion examples/builtin-swc-loader/rspack.config.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ const config = {
entry: {
main: "./src/index.jsx"
},
resolve: {
extensions: ["...", ".jsx"]
},
module: {
rules: [
{
@@ -41,7 +44,7 @@ const config = {
]
},
optimization: {
minimize: false, // Disabling minification because it takes too long on CI
minimize: false // Disabling minification because it takes too long on CI
},
plugins: [
new rspack.HtmlRspackPlugin({
3 changes: 3 additions & 0 deletions examples/cra-ts/rspack.config.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ const config = {
entry: {
main: "./src/index.tsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/cra/rspack.config.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ const config = {
entry: {
main: "./src/index.jsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
optimization: {
minimize: false // Disabling minification because it takes too long on CI
},
5 changes: 4 additions & 1 deletion examples/emotion/rspack.config.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,10 @@ const config = {
main: "./src/index.jsx"
},
optimization: {
minimize: false, // Disabling minification because it takes too long on CI
minimize: false // Disabling minification because it takes too long on CI
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
plugins: [
new rspack.HtmlRspackPlugin({
3 changes: 3 additions & 0 deletions examples/express/rspack.config.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ const config = {
entry: {
main: ["webpack/hot/poll?100", "./src/main.ts"]
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
7 changes: 5 additions & 2 deletions examples/loader-compat/rspack.config.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@ const config = {
},
target: "node",
externalsType: "commonjs",
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
@@ -130,7 +133,7 @@ const config = {
]
},
optimization: {
minimize: false, // Disabling minification because it takes too long on CI
},
minimize: false // Disabling minification because it takes too long on CI
}
};
module.exports = config;
3 changes: 3 additions & 0 deletions examples/nestjs/rspack.config.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ const config = {
entry: {
main: ["webpack/hot/poll?100", "./src/main.ts"]
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
5 changes: 4 additions & 1 deletion examples/react-15-classic/rspack.config.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ const config = {
entry: {
main: "./src/index.jsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
@@ -30,7 +33,7 @@ const config = {
]
},
optimization: {
minimize: false, // Disabling minification because it takes too long on CI
minimize: false // Disabling minification because it takes too long on CI
},
plugins: [
new rspack.HtmlRspackPlugin({
3 changes: 3 additions & 0 deletions examples/react-15/rspack.config.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ const config = {
entry: {
main: "./src/index.jsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/react-refresh-babel-loader/rspack.config.js
Original file line number Diff line number Diff line change
@@ -11,6 +11,9 @@ const config = {
optimization: {
minimize: false // Disabling minification because it takes too long on CI
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/react-refresh/rspack.config.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@ const config = {
mode: isProduction ? "production" : "development",
entry: { main: "./src/index.tsx" },
devtool: "source-map",
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/react-storybook/rspack.config.js
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@ module.exports = {
optimization: {
minimize: false // Disabling minification because it takes too long on CI
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/react-with-less/rspack.config.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ const config = {
entry: {
main: ["./src/index.jsx"]
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/react-with-sass/rspack.config.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ const config = {
entry: {
main: ["./src/index.jsx"]
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/react/rspack.config.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ const config = {
entry: {
main: "./src/index.jsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
5 changes: 4 additions & 1 deletion examples/solid/rspack.config.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ const config = {
entry: {
main: "./src/index.jsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
@@ -34,7 +37,7 @@ const config = {
]
},
optimization: {
minimize: false, // Disabling minification because it takes too long on CI
minimize: false // Disabling minification because it takes too long on CI
},
plugins: [
new rspack.HtmlRspackPlugin({
3 changes: 3 additions & 0 deletions examples/styled-components/rspack.config.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ const config = {
optimization: {
minimize: false // Disabling minification because it takes too long on CI
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
3 changes: 3 additions & 0 deletions examples/svgr/rspack.config.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@ const config = {
entry: {
main: "./index.jsx"
},
resolve: {
extensions: ["...", ".ts", ".tsx", ".jsx"]
},
module: {
rules: [
{
2 changes: 1 addition & 1 deletion examples/vue2-ts/rspack.config.js
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ const config = {
})
],
resolve: {
extensions: [".vue", "..."]
extensions: [".vue", ".ts", "..."]
},
module: {
rules: [
Loading