Skip to content

Commit b1bc3cb

Browse files
committed
webpack 5 prepare
1 parent ba435af commit b1bc3cb

21 files changed

+1183
-3935
lines changed

app/app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { Main } from './Main'
55
let dispose: any
66
setTimeout(() => {
77
dispose = run(Main, {
8-
DOM: makeDOMDriver('body')
8+
DOM: makeDOMDriver('body'),
99
})
1010
})
1111

1212
if ((<any>module).hot) {
13-
(<any>module).hot.accept();
14-
(<any>module).hot.dispose(() => {
13+
;(<any>module).hot.accept()
14+
;(<any>module).hot.dispose(() => {
1515
dispose()
1616
document.body.innerHTML = ''
1717
})

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"description": "Frictionless language packs for Webpack.",
55
"prettier": {
66
"semi": false,
7-
"singleQuote": true,
8-
"arrowParens": "avoid"
7+
"singleQuote": true
98
},
109
"keywords": [
1110
"i18n",
@@ -22,11 +21,12 @@
2221
"wp4-build": "ts-node-dev --respawn webpack4/build",
2322
"wp4-watch": "h --n lp-loader-wp4 -- ts-node-dev webpack4/watch",
2423
"wp4-wds": "ts-node-dev webpack4/wds",
25-
"wp5-build": "ts-node-dev webpack5/build",
26-
"wp5-watch": "h --n lp-loader-wp5 -- ts-node-dev webpack4/watch",
27-
"wp5-wds": "h --n lp-loader-wp5-wds -- ts-node-dev webpack4/wds",
24+
"wp5-build": "ts-node-dev --respawn webpack5/build",
25+
"wp5-watch": "ts-node-dev webpack5/watch",
26+
"wp5-wds": "ts-node-dev webpack5/wds",
2827
"test": "echo \"Error: no test specified\" && exit 1",
29-
"prepublishOnly": "tsc"
28+
"build": "tsc -p tsconfig.build.json",
29+
"prepublishOnly": "yarn build"
3030
},
3131
"author": "whitecolor",
3232
"files": [

src/lp-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type Module = {
5555
debugId: number
5656
context: string
5757
userRequest: string
58-
reasons: Reason[]
58+
reasons: Reason[] // only in webpack4
5959
}
6060

6161
interface Dependency {

tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig",
3+
"compilerOptions": {
4+
"outDir": "./lib",
5+
"noEmit": false
6+
},
7+
"include": ["src/*"]
8+
}

tsconfig.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
"noImplicitAny": true,
77
"noImplicitThis": true,
88
"noImplicitReturns": true,
9+
"esModuleInterop": true,
910
"noFallthroughCasesInSwitch": true,
10-
"outDir": "./lib",
1111
"declaration": true,
1212
"experimentalDecorators": true,
1313
"emitDecoratorMetadata": true,
1414
"newLine": "LF",
1515
"skipLibCheck": true,
16-
"noEmit": false,
16+
"noEmit": true,
1717
"baseUrl": ".",
1818
"paths": {
1919
"lp-loader": ["src/lp-loader.ts"]
@@ -22,7 +22,5 @@
2222
"formatCodeOptions": {
2323
"indentSize": 2,
2424
"tabSize": 2
25-
},
26-
"include": ["src/*"],
27-
"exclude": ["**/node_modules"]
25+
}
2826
}

webpack4/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010
"ts-loader": "^5.3.0",
1111
"webpack": "^4.25.1",
1212
"webpack-dev-server": "^3.1.10"
13+
},
14+
"devDependencies": {
15+
"webpack-cli": "^3.3.12"
1316
}
1417
}

webpack4/webpack.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as path from 'path'
44
const HtmlWebpackPlugin = require('html-webpack-plugin')
55
const CleanWebpackPlugin = require('clean-webpack-plugin')
66
import { LoaderOptions } from '../src/lp-loader'
7-
export const makeConfig = (isProduction = false) => {
7+
export const makeConfig = (isProduction = false) => {
88
const isDevelopment = !isProduction
99

1010
process.env.LP_DEBUG = 'true'

0 commit comments

Comments
 (0)