Unverified Commit 61de215e authored by Connor Davis's avatar Connor Davis Committed by GitHub

Move webpack config to TypeScript (#6348)

parent 0bf5041e
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
directories: ["node_modules"] directories: ["node_modules"]
}, },
before_install: [ before_install: [
"curl -o- -L https://yarnpkg.com/install.sh | bash",
"export PATH=\"$HOME/.yarn/bin:$PATH\"",
"export DISPLAY=:99.0", "export DISPLAY=:99.0",
"sh -e /etc/init.d/xvfb start", "sh -e /etc/init.d/xvfb start",
"sleep 3" "sleep 3"
...@@ -21,5 +23,5 @@ ...@@ -21,5 +23,5 @@
"rm -rf node_modules/.cache" "rm -rf node_modules/.cache"
], ],
before_script: [], before_script: [],
after_script: ["npm run coveralls"] after_script: ["yarn run coveralls"]
} }
...@@ -26,7 +26,7 @@ class Store { ...@@ -26,7 +26,7 @@ class Store {
let store = null let store = null
export function initializeStore (initialData) { export function initializeStore(initialData) {
// Always make a new store if server, otherwise state is shared between requests // Always make a new store if server, otherwise state is shared between requests
if (isServer) { if (isServer) {
return new Store(isServer, initialData) return new Store(isServer, initialData)
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
"lerna": "lerna", "lerna": "lerna",
"dev": "lerna run build --stream --parallel", "dev": "lerna run build --stream --parallel",
"testonly": "jest", "testonly": "jest",
"testall": "yarn check && npm run testonly -- --coverage --forceExit --runInBand --reporters=default --reporters=jest-junit", "testall": "yarn check && yarn run testonly -- --coverage --forceExit --runInBand --reporters=default --reporters=jest-junit",
"pretest": "npm run lint", "pretest": "yarn run lint",
"test": "npm run testall || npm run testall", "test": "yarn run testall || yarn run testall",
"coveralls": "cat ./test/coverage/lcov.info | coveralls", "coveralls": "cat ./test/coverage/lcov.info | coveralls",
"lint": "lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts", "lint": "lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
"lint-fix": "standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts", "lint-fix": "standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
"devDependencies": { "devDependencies": {
"@taskr/clear": "1.1.0", "@taskr/clear": "1.1.0",
"@taskr/watch": "1.1.0", "@taskr/watch": "1.1.0",
"@types/react": "16.7.13", "@types/react": "16.8.4",
"@types/react-dom": "16.0.11", "@types/react-dom": "16.8.2",
"@types/react-is": "16.5.0", "@types/react-is": "16.5.0",
"@types/send": "0.14.4", "@types/send": "0.14.4",
"taskr": "1.1.0", "taskr": "1.1.0",
......
...@@ -21,7 +21,7 @@ export function createPagesMapping(pagePaths: string[], extensions: string[]): P ...@@ -21,7 +21,7 @@ export function createPagesMapping(pagePaths: string[], extensions: string[]): P
return pages return pages
} }
type WebpackEntrypoints = { export type WebpackEntrypoints = {
[bundle: string]: string|string[] [bundle: string]: string|string[]
} }
......
...@@ -58,7 +58,7 @@ export default async function build(dir: string, conf = null): Promise<void> { ...@@ -58,7 +58,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
const pagePaths = await collectPages(pagesDir, config.pageExtensions) const pagePaths = await collectPages(pagesDir, config.pageExtensions)
const pages = createPagesMapping(pagePaths, config.pageExtensions) const pages = createPagesMapping(pagePaths, config.pageExtensions)
const entrypoints = createEntrypoints(pages, config.target, buildId, config) const entrypoints = createEntrypoints(pages, config.target, buildId, config)
const configs: any = [ const configs = [
getBaseWebpackConfig(dir, { getBaseWebpackConfig(dir, {
buildId, buildId,
isServer: false, isServer: false,
......
...@@ -111,6 +111,7 @@ ...@@ -111,6 +111,7 @@
"@types/babel__generator": "7.0.1", "@types/babel__generator": "7.0.1",
"@types/babel__template": "7.0.1", "@types/babel__template": "7.0.1",
"@types/babel__traverse": "7.0.3", "@types/babel__traverse": "7.0.3",
"@types/case-sensitive-paths-webpack-plugin": "2.1.2",
"@types/cross-spawn": "6.0.0", "@types/cross-spawn": "6.0.0",
"@types/etag": "1.8.0", "@types/etag": "1.8.0",
"@types/fresh": "0.5.0", "@types/fresh": "0.5.0",
...@@ -119,9 +120,9 @@ ...@@ -119,9 +120,9 @@
"@types/mkdirp": "0.5.2", "@types/mkdirp": "0.5.2",
"@types/nanoid": "1.2.0", "@types/nanoid": "1.2.0",
"@types/node-fetch": "2.1.4", "@types/node-fetch": "2.1.4",
"@types/resolve": "0.0.8",
"@types/rimraf": "2.0.2", "@types/rimraf": "2.0.2",
"@types/signal-exit": "3.0.0", "@types/signal-exit": "3.0.0",
"@types/webpack": "4.4.22",
"taskr": "1.1.0", "taskr": "1.1.0",
"typescript": "3.1.6" "typescript": "3.1.6"
}, },
......
...@@ -25,4 +25,24 @@ declare module 'arg' { ...@@ -25,4 +25,24 @@ declare module 'arg' {
} }
export = arg; export = arg;
} }
\ No newline at end of file declare module 'autodll-webpack-plugin' {
import webpack from 'webpack'
class AutoDllPlugin implements webpack.Plugin {
constructor(settings?: {
inject?: boolean,
plugins?: webpack.Configuration["plugins"],
context?: string,
debug?: boolean,
filename?: string,
path?: string,
inherit?: boolean,
entry?: webpack.Entry,
config?: webpack.Configuration
})
apply: webpack.Plugin["apply"]
[k: string]: any
}
export = AutoDllPlugin
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment