Created
October 3, 2018 21:16
-
-
Save stepquick/ffd78fa456ab91a2ccbb787e1e7236ed to your computer and use it in GitHub Desktop.
sample ts config for webpack dev server
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
{ | |
"name": "tsconfig", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"dev": "webpack-dev-server --config webpack.config.ts" | |
}, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"@types/node": "^10.11.4", | |
"@types/webpack": "^4.4.14", | |
"ts-loader": "^5.2.1", | |
"ts-node": "^7.0.1", | |
"typescript": "^3.1.1", | |
"webpack": "^4.20.2", | |
"webpack-cli": "^3.1.2", | |
"webpack-dev-server": "^3.1.9" | |
} | |
} |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es5", | |
"noImplicitAny": true, | |
"removeComments": true, | |
"preserveConstEnums": true, | |
"sourceMap": true | |
} | |
} |
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
import * as path from 'path'; | |
module.exports = { | |
entry: './src/index.ts', | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
use: 'ts-loader', | |
exclude: /node_modules/ | |
} | |
] | |
}, | |
resolve: { | |
extensions: ['.tsx', '.ts', '.js'] | |
}, | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'public/assets'), | |
publicPath: "/assets", | |
}, | |
devServer: { inline: true }, | |
devtool: "source-map", | |
mode: "development" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment