Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sample ts config for webpack dev server
{
"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"
}
}
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
}
}
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
You can’t perform that action at this time.