Skip to content

Commit c52f8df

Browse files
committed
docs: adjust config in readme
- add import to conditions - explain that alias shouldn't be needed most of the time
1 parent 5c1ee5a commit c52f8df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ Configure inside your `webpack.config.js`:
2222
...
2323
resolve: {
2424
// see below for an explanation
25-
alias: {
26-
svelte: path.resolve('node_modules', 'svelte')
27-
},
25+
// alias: {
26+
// svelte: path.resolve('node_modules', 'svelte/src/runtime') // Svelte 3: path.resolve('node_modules', 'svelte')
27+
// },
2828
extensions: ['.mjs', '.js', '.svelte'],
2929
mainFields: ['svelte', 'browser', 'module', 'main'],
30-
conditionNames: ['svelte', 'browser']
30+
conditionNames: ['svelte', 'browser', 'import']
3131
},
3232
module: {
3333
rules: [
@@ -53,7 +53,7 @@ Check out the [example project](https://github.com/sveltejs/template-webpack).
5353

5454
### resolve.alias
5555

56-
The [`resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias) option is used to make sure that only one copy of the Svelte runtime is bundled in the app, even if you are `npm link`ing in dependencies with their own copy of the `svelte` package. Having multiple copies of the internal scheduler in an app, besides being inefficient, can also cause various problems.
56+
The [`resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias) option is used to make sure that only one copy of the Svelte runtime is bundled in the app, even if you are `npm link`ing in dependencies with their own copy of the `svelte` package. Having multiple copies of the internal scheduler in an app, besides being inefficient, can also cause various problems. It's commented out because you rarely should need this and it's brittle since it relies on the internal structure of the Svelte package, which can change.
5757

5858
### resolve.mainFields
5959

0 commit comments

Comments
 (0)