-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docz-bundler-webpack): add bundler as package
- Loading branch information
1 parent
8a92fbf
commit d7be8a9
Showing
18 changed files
with
185 additions
and
101 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "playgrodd-bundler-webpack", | ||
"version": "0.0.1", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"source": "src/index.ts", | ||
"license": "MIT", | ||
"scripts": { | ||
"clean": "trash dist", | ||
"compile": "tsc -p tsconfig.json", | ||
"dev": "run-s clean && run-s \"compile -w\"", | ||
"build": "run-s clean && run-s compile", | ||
"fix": "run-s fix:*", | ||
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" --write", | ||
"fix:tslint": "tslint --fix --project ." | ||
}, | ||
"dependencies": { | ||
"@babel/core": "^7.0.0-beta.44", | ||
"@babel/runtime": "^7.0.0-beta.44", | ||
"babel-polyfill": "^7.0.0-beta.3", | ||
"babel-loader": "^8.0.0-beta.1", | ||
"babel-preset-react-app": "^4.0.0-next.b2fd8db8", | ||
"deepmerge": "^2.1.0", | ||
"html-webpack-plugin": "^3.2.0", | ||
"load-cfg": "^0.0.1", | ||
"playgrodd-core": "^0.0.1", | ||
"react-dev-utils": "^5.0.1", | ||
"react-hot-loader": "^4.0.1", | ||
"thread-loader": "^1.1.5", | ||
"webpack": "^4.5.0", | ||
"webpack-dev-middleware": "^3.1.2", | ||
"webpack-dev-server": "^3.1.3" | ||
}, | ||
"devDependencies": { | ||
"@types/deepmerge": "^2.1.0", | ||
"@types/html-webpack-plugin": "^2.30.3", | ||
"@types/node": "9.6.4", | ||
"@types/webpack": "^4.1.3", | ||
"@types/webpack-dev-server": "^2.9.4" | ||
} | ||
} |
8 changes: 5 additions & 3 deletions
8
.../src/bundlers/webpack/config-devserver.ts → ...d-bundler-webpack/src/config-devserver.ts
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
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,13 @@ | ||
import { Bundler, IBundlerFactoryParams } from 'playgrodd-core' | ||
import { Configuration } from 'webpack' | ||
import * as WebpackDevServer from 'webpack-dev-server' | ||
|
||
import { config, setup, server } from './config.dev' | ||
|
||
export const create = (params: IBundlerFactoryParams) => | ||
new Bundler<Configuration, WebpackDevServer>({ | ||
id: 'webpack', | ||
config: config(params), | ||
server: server(params), | ||
setup: setup(params), | ||
}) |
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,15 @@ | ||
import { Loader } from 'webpack' | ||
|
||
import * as merge from 'deepmerge' | ||
import { load } from 'load-cfg' | ||
|
||
export const babel: Loader = { | ||
loader: require.resolve('babel-loader'), | ||
options: merge(load('babel', null), { | ||
babelrc: false, | ||
cacheDirectory: true, | ||
highlightCode: true, | ||
presets: [require.resolve('babel-preset-react-app')], | ||
plugins: [require.resolve('react-hot-loader/babel')], | ||
}), | ||
} |
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,2 @@ | ||
declare module 'react-dev-utils/errorOverlayMiddleware' | ||
declare module 'react-dev-utils/WebpackDevServerUtils' |
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,14 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"outDir": "dist", | ||
"rootDir": "src", | ||
"types": ["node"], | ||
"typeRoots": ["node_modules/@types", "src/types"] | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules/**"] | ||
} |
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,3 @@ | ||
{ | ||
"extends": "../../tslint.json" | ||
} |
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,53 +1,37 @@ | ||
{ | ||
"name": "playgrodd-core", | ||
"version": "0.0.1", | ||
"main": "./dist/main/index.js", | ||
"typings": "./dist/main/index.d.ts", | ||
"module": "./dist/module/index.js", | ||
"main": "dist/index.js", | ||
"umd:main": "dist/index.umd.js", | ||
"module": "dist/index.m.js", | ||
"source": "src/index.ts", | ||
"typings": "./dist/index.d.ts", | ||
"scripts": { | ||
"copy-templates": "node scripts/copy-templates", | ||
"clean": "trash dist && yarn copy-templates", | ||
"dev": "run-s clean build:main && run-p \"build:main -- -w\"", | ||
"build": "run-s clean && run-p build:*", | ||
"build:main": "tsc -p tsconfig.json", | ||
"build:module": "tsc -p tsconfig.module.json", | ||
"clean": "trash dist", | ||
"postclean": "run-s copy-templates", | ||
"compile": "tsc -p tsconfig.json", | ||
"dev": "run-s clean && run-s \"compile -w\"", | ||
"build": "run-s clean && run-s compile", | ||
"fix": "run-s fix:*", | ||
"fix:prettier": "prettier \"src/**/*.{ts,tsx}\" --write", | ||
"fix:tslint": "tslint --fix --project ." | ||
}, | ||
"dependencies": { | ||
"@babel/core": "^7.0.0-beta.44", | ||
"@babel/runtime": "^7.0.0-beta.44", | ||
"art-template": "^4.12.2", | ||
"babel-loader": "^8.0.0-beta.1", | ||
"babel-polyfill": "^7.0.0-beta.3", | ||
"babel-traverse": "^6.26.0", | ||
"babel-types": "^6.26.0", | ||
"babylon": "^6.18.0", | ||
"deepmerge": "^2.1.0", | ||
"del": "^3.0.0", | ||
"express": "^4.16.3", | ||
"fast-glob": "^2.2.0", | ||
"html-webpack-plugin": "^3.2.0", | ||
"load-cfg": "^0.0.1", | ||
"mkdirp": "^0.5.1", | ||
"react-dev-utils": "^5.0.1", | ||
"react-hot-loader": "^4.0.1", | ||
"webpack": "^4.5.0", | ||
"webpack-dev-middleware": "^3.1.2", | ||
"webpack-dev-server": "^3.1.3", | ||
"webpack-messages": "^1.0.1" | ||
"mkdirp": "^0.5.1" | ||
}, | ||
"devDependencies": { | ||
"@types/babel-traverse": "^6.25.3", | ||
"@types/babylon": "^6.16.2", | ||
"@types/deepmerge": "^2.1.0", | ||
"@types/del": "^3.0.1", | ||
"@types/express": "^4.11.1", | ||
"@types/mkdirp": "^0.5.2", | ||
"@types/webpack": "^4.1.3", | ||
"@types/webpack-dev-server": "^2.9.4", | ||
"@types/html-webpack-plugin": "^2.30.3", | ||
"shelljs": "^0.8.1" | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export { Paths } from './config/Paths' | ||
|
||
export { Server } from './server' | ||
export { Entry } from './Entry' | ||
export { Bundler, IBundlerFactoryParams } from './Bundler' |
Oops, something went wrong.