Skip to content

Commit

Permalink
webpack 5 prepare
Browse files Browse the repository at this point in the history
  • Loading branch information
wclr committed Sep 6, 2020
1 parent ba435af commit b1bc3cb
Show file tree
Hide file tree
Showing 21 changed files with 1,183 additions and 3,935 deletions.
6 changes: 3 additions & 3 deletions app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { Main } from './Main'
let dispose: any
setTimeout(() => {
dispose = run(Main, {
DOM: makeDOMDriver('body')
DOM: makeDOMDriver('body'),
})
})

if ((<any>module).hot) {
(<any>module).hot.accept();
(<any>module).hot.dispose(() => {
;(<any>module).hot.accept()
;(<any>module).hot.dispose(() => {
dispose()
document.body.innerHTML = ''
})
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"description": "Frictionless language packs for Webpack.",
"prettier": {
"semi": false,
"singleQuote": true,
"arrowParens": "avoid"
"singleQuote": true
},
"keywords": [
"i18n",
Expand All @@ -22,11 +21,12 @@
"wp4-build": "ts-node-dev --respawn webpack4/build",
"wp4-watch": "h --n lp-loader-wp4 -- ts-node-dev webpack4/watch",
"wp4-wds": "ts-node-dev webpack4/wds",
"wp5-build": "ts-node-dev webpack5/build",
"wp5-watch": "h --n lp-loader-wp5 -- ts-node-dev webpack4/watch",
"wp5-wds": "h --n lp-loader-wp5-wds -- ts-node-dev webpack4/wds",
"wp5-build": "ts-node-dev --respawn webpack5/build",
"wp5-watch": "ts-node-dev webpack5/watch",
"wp5-wds": "ts-node-dev webpack5/wds",
"test": "echo \"Error: no test specified\" && exit 1",
"prepublishOnly": "tsc"
"build": "tsc -p tsconfig.build.json",
"prepublishOnly": "yarn build"
},
"author": "whitecolor",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/lp-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Module = {
debugId: number
context: string
userRequest: string
reasons: Reason[]
reasons: Reason[] // only in webpack4
}

interface Dependency {
Expand Down
8 changes: 8 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"outDir": "./lib",
"noEmit": false
},
"include": ["src/*"]
}
8 changes: 3 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"esModuleInterop": true,
"noFallthroughCasesInSwitch": true,
"outDir": "./lib",
"declaration": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"newLine": "LF",
"skipLibCheck": true,
"noEmit": false,
"noEmit": true,
"baseUrl": ".",
"paths": {
"lp-loader": ["src/lp-loader.ts"]
Expand All @@ -22,7 +22,5 @@
"formatCodeOptions": {
"indentSize": 2,
"tabSize": 2
},
"include": ["src/*"],
"exclude": ["**/node_modules"]
}
}
3 changes: 3 additions & 0 deletions webpack4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"ts-loader": "^5.3.0",
"webpack": "^4.25.1",
"webpack-dev-server": "^3.1.10"
},
"devDependencies": {
"webpack-cli": "^3.3.12"
}
}
2 changes: 1 addition & 1 deletion webpack4/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as path from 'path'
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
import { LoaderOptions } from '../src/lp-loader'
export const makeConfig = (isProduction = false) => {
export const makeConfig = (isProduction = false) => {
const isDevelopment = !isProduction

process.env.LP_DEBUG = 'true'
Expand Down
Loading

0 comments on commit b1bc3cb

Please sign in to comment.