Skip to content

Commit 265bf9a

Browse files
chore: set up frontend out dir
1 parent 698f94b commit 265bf9a

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ __pycache__
88
db.sqlite3
99

1010
# Webpack
11-
dist
11+
frontend/static/frontend
1212

1313
# npm
1414
node_modules

frontend/jest.config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
const modules = [].join("|");
22

33
module.exports = {
4-
modulePathIgnorePatterns: ["<rootDir>/dist/", "<rootDir>/node_modules/"],
4+
modulePathIgnorePatterns: [
5+
"<rootDir>/static/frontend/",
6+
"<rootDir>/node_modules/",
7+
],
58
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
69
moduleNameMapper: {
710
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$":
8-
"jest-transform-stub"
11+
"jest-transform-stub",
912
},
1013
transform: {
11-
"^.+\\.(ts|js|tsx)$": "babel-jest"
14+
"^.+\\.(ts|js|tsx)$": "babel-jest",
1215
},
1316
coverageThreshold: {
1417
global: {
1518
branches: 70,
1619
functions: 70,
1720
lines: 70,
18-
statements: 70
19-
}
21+
statements: 70,
22+
},
2023
},
2124
verbose: true,
2225
setupFilesAfterEnv: ["./jest.setup.js"],
23-
transformIgnorePatterns: [`<rootDir>/node_modules/(?!(${modules})/)`]
26+
transformIgnorePatterns: [`<rootDir>/node_modules/(?!(${modules})/)`],
2427
};

frontend/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"outDir": "./dist/",
3+
"outDir": "./static/frontend/",
44
"target": "es5",
55
"jsx": "react",
66
"moduleResolution": "node",
@@ -14,6 +14,6 @@
1414
"module": "esnext",
1515
"lib": ["es6", "dom", "dom.iterable"]
1616
},
17-
"include": ["./src/**/*"],
18-
"exclude": ["node_modules", "dist", "**/__tests__/**/*"]
17+
"include": ["./**/*"],
18+
"exclude": ["node_modules", "static/frontend", "**/__tests__/**/*"]
1919
}

frontend/webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ if (process.env.NODE_ENV === "development") {
1616
module.exports = {
1717
context: __dirname,
1818
mode: process.env.NODE_ENV,
19-
entry: "./src/index.tsx",
19+
entry: "./index.tsx",
2020
output: {
21-
filename: "bundle.js",
21+
filename: "index.js",
2222
path: path.resolve(__dirname, "static/frontend"),
2323
publicPath: "/",
2424
},
@@ -32,7 +32,7 @@ module.exports = {
3232
},
3333
plugins: [
3434
new HtmlWebpackPlugin({
35-
template: path.resolve(__dirname, "index.html"),
35+
template: path.resolve(__dirname, "templates", "frontend", "index.html"),
3636
filename: "index.html",
3737
}),
3838
new CopyWebpackPlugin([{ from: "pwa" }]),

0 commit comments

Comments
 (0)