Skip to content

Instantly share code, notes, and snippets.

@dmitriid
Created December 4, 2017 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitriid/182a253aaac532fd984556e5f41fca96 to your computer and use it in GitHub Desktop.
Save dmitriid/182a253aaac532fd984556e5f41fca96 to your computer and use it in GitHub Desktop.
module.exports = {
devtool: 'source-map',
entry: ['./src/index.tsx'],
output: {
filename: 'bundle.js',
path: __dirname + '/dist/'
},
module: {
rules: [
{
test: /\.tsx?$/,
use: ['ts-loader'],
exclude: /node_modules/,
},
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
}
};
@dmitriid
Copy link
Author

dmitriid commented Dec 4, 2017

tsconfig.json

{
  "compilerOptions": {
    "outDir": "./.build/",
    "sourceMap": true,
    "noImplicitAny": true,
    "module": "es6",
    "target": "es5",
    "jsx": "react"
  }
}

@dmitriid
Copy link
Author

dmitriid commented Dec 4, 2017

package.json

{
  "name": "x",
  "version": "0.1.0",
  "description": "",
  "main": "dist/index.js",
  "repository": "",
  "author": "",
  "license": "MIT",
  "scripts": {
    "build": "webpack",
    "watch": "webpack -w"
  },
  "devDependencies": {
    "@types/react": "^16.0.9",
    "@types/react-dom": "^16.0.0",
    "ts-loader": "^2.3.7",
    "typescript": "^2.5.3",
    "webpack": "^3.6.0"
  },
  "dependencies": {
    "react": "^16.0.0",
    "react-dom": "^16.0.0"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment