@@ -3,10 +3,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
3
3
const webpack = require ( 'webpack' )
4
4
const fs = require ( 'fs' )
5
5
6
- const createAlias = ( name , fallback ) =>
7
- fs . existsSync ( `./../${ name } ` )
8
- ? path . resolve ( `./../${ name } ` )
9
- : fallback || name
6
+ const createAlias = ( name , fallback ) => ( fs . existsSync ( name ) ? name : fallback )
10
7
11
8
module . exports = mode => {
12
9
return {
@@ -54,21 +51,13 @@ module.exports = mode => {
54
51
modules : [ path . resolve ( './' ) , 'node_modules' ] ,
55
52
extensions : [ '.js' , '.jsx' , '.ts' , '.tsx' ] ,
56
53
alias : {
57
- 'react-spring$' : createAlias (
58
- 'react-spring/src/targets/web' ,
59
- 'react-spring'
60
- ) ,
61
- 'react-spring/renderprops' : createAlias (
62
- 'react-spring/src/renderprops/targets/web' ,
63
- 'react-spring/renderprops'
64
- ) ,
65
- 'react-spring/renderprops-addons' : createAlias (
66
- 'react-spring/src/renderprops/addons' ,
67
- 'react-spring/renderprops-addons'
68
- ) ,
69
54
react : path . resolve ( 'node_modules/react' ) ,
70
55
'react-dom' : path . resolve ( 'node_modules/react-dom' ) ,
71
56
'prop-types' : path . resolve ( 'node_modules/prop-types' ) ,
57
+ 'react-spring$' : createAlias (
58
+ '../packages/react-spring' ,
59
+ '@react-spring/web'
60
+ ) ,
72
61
} ,
73
62
} ,
74
63
plugins : [ new HtmlWebpackPlugin ( { template : 'template.html' } ) ] ,
0 commit comments