Skip to content

Commit af43366

Browse files
Webpack config added.
1 parent b71f343 commit af43366

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dist
88
# Ignore Rush temporary files
99
/common/temp/**
1010

11-
**/webpack.config.js
11+
# **/webpack.config.js
1212
.rpt2_cache
1313
_src
1414
coverage

webpack.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const path = require("path");
2+
// Plugins
3+
const webpackBuilder = require("@reactway/webpack-builder");
4+
const typeScript = require("@reactway/webpack-builder-plugin-typescript");
5+
const webpackDevServer = require("@reactway/webpack-builder-plugin-web-dev");
6+
const htmlPlugin = require("@reactway/webpack-builder-plugin-html");
7+
const styles = require("@reactway/webpack-builder-plugin-styles");
8+
const images = require("@reactway/webpack-builder-plugin-images");
9+
const clean = require("@reactway/webpack-builder-plugin-clean");
10+
const writeFile = require("@reactway/webpack-builder-plugin-write-file");
11+
// Packages not included to plugins.
12+
// const CopyPlugin = require("copy-webpack-plugin");
13+
14+
const fullOutputPath = path.resolve(__dirname, "dist");
15+
16+
module.exports = new webpackBuilder.Builder(__dirname, {
17+
entry: "./src/app.tsx",
18+
mode: "development",
19+
output: {
20+
path: fullOutputPath,
21+
filename: "[name].bundle.js"
22+
}
23+
})
24+
.use(typeScript.TypeScriptPlugin)
25+
.use(webpackDevServer)
26+
.use(htmlPlugin)
27+
.use(styles.StylesPlugin)
28+
.use(images)
29+
.use(clean)
30+
.use(writeFile)
31+
// .update(webpack => {
32+
// webpack.plugins.push(new CopyPlugin([{ from: "src/assets/", to: "./assets" }]));
33+
// return webpack;
34+
// })
35+
.toConfig();

0 commit comments

Comments
 (0)