Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Update React & Webpack.md #511

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions pages/tutorials/React & Webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,23 @@ module.exports = {

resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},

module: {
loaders: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" }
rules: [
{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader',
exclude: /(node_modules)/,
},
{
test: /\.tsx?$/,
loaders: ['awesome-typescript-loader'],
exclude: /(node_modules)/
},
],

preLoaders: [
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ test: /\.js$/, loader: "source-map-loader" }
]
},

// When importing a module whose path matches one of the following, just
Expand Down