File tree Expand file tree Collapse file tree 3 files changed +27
-20
lines changed Expand file tree Collapse file tree 3 files changed +27
-20
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,15 @@ const { merge } = require("webpack-merge");
7
7
const baseForModules = {
8
8
devtool : false ,
9
9
mode : "production" ,
10
- experiments : {
11
- outputModule : true ,
12
- } ,
10
+ // TODO enable this in future after fix bug with `eval` in webpack
11
+ // experiments: {
12
+ // outputModule: true,
13
+ // },
13
14
output : {
14
15
path : path . resolve ( __dirname , "../client/modules" ) ,
15
16
library : {
16
- type : "module" ,
17
+ // type: "module",
18
+ type : "commonjs" ,
17
19
} ,
18
20
} ,
19
21
optimization : {
@@ -40,21 +42,21 @@ module.exports = [
40
42
output : {
41
43
filename : "logger/index.js" ,
42
44
} ,
43
- // module: {
44
- // rules: [
45
- // {
46
- // test: /\.js$/,
47
- // use: [
48
- // {
49
- // loader: "babel-loader",
50
- // options: {
51
- // plugins: ["@babel/plugin-transform-object-assign"],
52
- // },
53
- // },
54
- // ],
55
- // },
56
- // ],
57
- // },
45
+ module : {
46
+ rules : [
47
+ {
48
+ test : / \. j s $ / ,
49
+ use : [
50
+ {
51
+ loader : "babel-loader" ,
52
+ options : {
53
+ plugins : [ "@babel/plugin-transform-object-assign" ] ,
54
+ } ,
55
+ } ,
56
+ ] ,
57
+ } ,
58
+ ] ,
59
+ } ,
58
60
plugins : [
59
61
new webpack . DefinePlugin ( {
60
62
Symbol :
@@ -76,6 +78,9 @@ module.exports = [
76
78
entry : path . join ( __dirname , "modules/sockjs-client/index.js" ) ,
77
79
output : {
78
80
filename : "sockjs-client/index.js" ,
81
+ library : "SockJS" ,
82
+ libraryTarget : "umd" ,
83
+ globalObject : "(typeof self !== 'undefined' ? self : this)" ,
79
84
} ,
80
85
} ) ,
81
86
] ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ describe("entry", () => {
40
40
41
41
const itOnlyWebpack5 = isWebpack5 ? it : it . skip ;
42
42
43
- it ( "should work with single entry" , async ( ) => {
43
+ it . only ( "should work with single entry" , async ( ) => {
44
44
const compiler = webpack ( { ...config , entry : entryFirst } ) ;
45
45
const devServerOptions = {
46
46
host : "127.0.0.1" ,
@@ -73,6 +73,7 @@ describe("entry", () => {
73
73
pageErrors . push ( error ) ;
74
74
} ) ;
75
75
76
+ console . log ( `http://127.0.0.1:${ port } /main` ) ;
76
77
await page . goto ( `http://127.0.0.1:${ port } /main` , {
77
78
waitUntil : "networkidle0" ,
78
79
} ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const HTMLContent = `
12
12
` ;
13
13
14
14
module . exports = {
15
+ devtool : "eval-nosources-cheap-source-map" ,
15
16
mode : "development" ,
16
17
context : __dirname ,
17
18
stats : "none" ,
You can’t perform that action at this time.
0 commit comments