File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
const { rspack } = require ( '@rspack/core' ) ;
2
2
const { VueLoaderPlugin } = require ( 'vue-loader' ) ;
3
+ const path = require ( 'path' ) ;
4
+
5
+ const toPosixPath = ( filepath ) => ( path . sep === '/' ? filepath : filepath . replace ( / \\ / g, '/' ) ) ;
3
6
4
7
/** @type {import('@rspack/cli').Configuration } */
5
8
const config = {
@@ -10,7 +13,11 @@ const config = {
10
13
devServer : {
11
14
historyApiFallback : true ,
12
15
} ,
13
- devtool : false ,
16
+ output : {
17
+ // ensure the source map is correct for .vue files
18
+ devtoolModuleFilenameTemplate : ( info ) => toPosixPath ( info . absoluteResourcePath ) ,
19
+ } ,
20
+ devtool : process . env . NODE_ENV === 'development' ? 'cheap-module-source-map' : false ,
14
21
plugins : [
15
22
new VueLoaderPlugin ( ) ,
16
23
new rspack . HtmlRspackPlugin ( {
@@ -30,7 +37,6 @@ const config = {
30
37
test : / \. t s $ / ,
31
38
loader : 'builtin:swc-loader' ,
32
39
options : {
33
- sourceMap : true ,
34
40
jsc : {
35
41
parser : {
36
42
syntax : 'typescript' ,
You can’t perform that action at this time.
0 commit comments