Skip to content

Commit 3ccd4e6

Browse files
committed
fix: fix webpack resolve suffix
1 parent 11d9039 commit 3ccd4e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

webpack.config.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (env) => {
99

1010
return {
1111
mode: isBuild ? 'production' : 'development',
12-
entry: isBuild ? './src' : './example/index.js',
12+
entry: isBuild ? './src' : './example',
1313

1414
output: {
1515
path: path.join(__dirname, isExample ? '__site__' : 'dist'),
@@ -35,10 +35,14 @@ module.exports = (env) => {
3535
},
3636
} : {},
3737

38+
resolve: {
39+
extensions: ['.js', '.jsx', '.json'],
40+
},
41+
3842
module: {
3943
rules: [
4044
{
41-
test: /\.js?$/,
45+
test: /\.jsx?$/,
4246
exclude: /node_modules/,
4347
use: ['babel-loader'],
4448
},

0 commit comments

Comments
 (0)