Alex Mikhalev
8 years ago
5 changed files with 49 additions and 40 deletions
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
const path = require("path"); |
||||
const webpack = require("webpack"); |
||||
const HtmlWebpackPlugin = require("html-webpack-plugin"); |
||||
|
||||
module.exports = { |
||||
devtool: "inline-source-map", |
||||
output: { |
||||
path: path.resolve(__dirname, "..", "build"), |
||||
filename: "bundle.js" |
||||
}, |
||||
resolve: { |
||||
extensions: [".ts", ".tsx", ".js"], |
||||
alias: { |
||||
app: path.resolve(__dirname, "..", "app") |
||||
} |
||||
}, |
||||
module: { |
||||
rules: [ |
||||
{ test: /\.css$/, loader: "style-loader!css-loader" }, |
||||
{ test: /\.(ttf|eot|svg|woff(2)?|png|jpg)(\?[a-z0-9=&.]+)?$/, loader: "file-loader" } |
||||
] |
||||
}, |
||||
plugins: [ |
||||
new HtmlWebpackPlugin({ |
||||
template: "./app/index.html" |
||||
}), |
||||
new webpack.NamedModulesPlugin(), |
||||
new webpack.HotModuleReplacementPlugin() |
||||
], |
||||
devServer: { |
||||
hot: true |
||||
} |
||||
}; |
@ -1,32 +1,16 @@
@@ -1,32 +1,16 @@
|
||||
const path = require("path"); |
||||
const webpack = require("webpack"); |
||||
const HtmlWebpackPlugin = require("html-webpack-plugin"); |
||||
const webpackMerge = require("webpack-merge"); |
||||
const base = require("./base.config"); |
||||
|
||||
module.exports = { |
||||
module.exports = webpackMerge.smart(base, { |
||||
entry: [ |
||||
"./app/script/index.tsx" |
||||
], |
||||
devtool: "none", |
||||
output: { |
||||
path: path.resolve(__dirname, "../dist"), |
||||
filename: "bundle.js" |
||||
}, |
||||
resolve: { |
||||
extensions: [".ts", ".tsx", ".js"], |
||||
alias: { |
||||
app: path.resolve("./app") |
||||
} |
||||
}, |
||||
module: { |
||||
rules: [ |
||||
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" }, |
||||
{ test: /\.css$/, loader: "style-loader!css-loader" }, |
||||
{ test: /\.(ttf|eot|svg|woff(2)?|png|jpg)(\?[a-z0-9=&.]+)?$/, loader: "file-loader" } |
||||
] |
||||
}, |
||||
plugins: [ |
||||
new HtmlWebpackPlugin({ |
||||
template: "./app/index.html" |
||||
}) |
||||
] |
||||
}; |
||||
}); |
||||
|
Loading…
Reference in new issue