Skip to content

Commit 344f007

Browse files
authored
docs: uncomment alias again
sometimes needed also when there are svelte component libraries using svelte
1 parent c52f8df commit 344f007

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Configure inside your `webpack.config.js`:
2222
...
2323
resolve: {
2424
// see below for an explanation
25-
// alias: {
26-
// svelte: path.resolve('node_modules', 'svelte/src/runtime') // Svelte 3: 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'],
3030
conditionNames: ['svelte', 'browser', 'import']
@@ -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. 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.
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.
5757

5858
### resolve.mainFields
5959

0 commit comments

Comments
 (0)