-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move types to `pluing/types.d.ts` - Update plugin signature to webpack 5 inclusive format - Add webpack type check to `check-ts` - Add `yarn dev-ts` TS-based configuration example to our examples...
- Loading branch information
1 parent
8a725a4
commit 4802585
Showing
7 changed files
with
149 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* No-op build with TS config to see if webpack-cli bombs out. | ||
*/ | ||
|
||
import DashboardPlugin from '../../plugin'; | ||
|
||
import * as path from 'path'; | ||
import * as webpack from 'webpack'; | ||
const webpackVers = webpack.version; | ||
|
||
const cwd = `${process.cwd()}/examples/${process.env.EXAMPLE}`; | ||
if (!process.env.EXAMPLE) { | ||
throw new Error("EXAMPLE is required"); | ||
} | ||
|
||
const mode = process.env.WEBPACK_MODE || "development"; | ||
|
||
const config: webpack.Configuration = { | ||
mode: 'development', | ||
entry: { | ||
bundle: "./src/index.js" | ||
}, | ||
context: path.resolve(cwd), | ||
output: { | ||
path: path.resolve(cwd, `dist-ts-${mode}-${webpackVers}`), | ||
pathinfo: true, | ||
filename: "[name].js" | ||
}, | ||
devtool: false, | ||
plugins: [ | ||
new DashboardPlugin() | ||
] | ||
}; | ||
|
||
export default config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
interface IMessage { | ||
type: string; | ||
value: string | number | { [key: string]: any } | ||
error?: boolean; | ||
} | ||
|
||
interface IDashboardOptions { | ||
port?: number; | ||
host?: string; | ||
handler?: (dataArray: IMessage[]) => void; | ||
} | ||
|
||
interface ICompiler { | ||
hooks?: any; | ||
plugin?: (name: string, callback: () => void) => void; | ||
} | ||
|
||
export default class DashboardPlugin { | ||
constructor(options?: IDashboardOptions); | ||
apply(compiler: ICompiler): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters