Skip to content

Commit d5e8126

Browse files
committed
Update webpack and tsconfig for core 1.0
1 parent a130631 commit d5e8126

File tree

4 files changed

+573
-267
lines changed

4 files changed

+573
-267
lines changed

js/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
6-
"@babel/preset-typescript": "^7.13.0",
7-
"flarum-webpack-config": "0.1.0-beta.10",
6+
"flarum-webpack-config": "0.1.0-beta.16.2",
87
"webpack": "^4.46.0",
9-
"webpack-cli": "^4.5.0",
8+
"webpack-cli": "^4.7.0",
109
"webpack-merge": "^5.7.3"
1110
},
1211
"devDependencies": {
1312
"@types/jquery": "^3.5.5",
14-
"@types/mithril": "^2.0.6",
13+
"@types/mithril": "^2.0.7",
1514
"dayjs": "^1.10.4",
1615
"flarum": "^0.1.0-beta.16",
1716
"jquery": "^3.6.0"

js/tsconfig.json

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
{
2-
"include": ["src/**/*.ts", "src/**/*.tsx"],
2+
// Use Flarum's tsconfig as a starting point
3+
"extends": "flarum-tsconfig",
4+
// This will match all .ts, .tsx, .d.ts, .js, .jsx files
5+
"include": ["src/**/*"],
36
"compilerOptions": {
4-
"allowUmdGlobalAccess": true,
5-
"outDir": "dist",
6-
"sourceMap": true,
7-
"strict": true,
8-
"noImplicitReturns": false,
9-
"noImplicitAny": false,
10-
"module": "es2015",
11-
"emitDecoratorMetadata": true,
12-
"experimentalDecorators": true,
13-
"esModuleInterop": true,
14-
"moduleResolution": "node",
15-
"target": "es6",
16-
"jsx": "preserve",
17-
"lib": ["es2015", "es2017", "dom"],
18-
"allowSyntheticDefaultImports": true,
19-
"noEmit": true
7+
// This will output typings to `dist-typings`
8+
"declarationDir": "./dist-typings"
209
}
2110
}

js/webpack.config.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
const config = require('flarum-webpack-config')
2-
const { merge } = require('webpack-merge')
32

4-
module.exports = merge(config(), {
5-
// output: {
6-
// library: "flarum.core",
7-
// },
8-
9-
// temporary TS configuration
10-
resolve: {
11-
extensions: ['.ts', '.tsx', '.js', '.json'],
12-
},
13-
})
14-
15-
module.exports['module'].rules[0].test = /\.(tsx?|js)$/
16-
module.exports['module'].rules[0].use.options.presets.push('@babel/preset-typescript')
3+
module.exports = config()

0 commit comments

Comments
 (0)