Created
July 1, 2020 19:49
-
-
Save BishopKO/aa6629bd7c83abea9f353c87e9678780 to your computer and use it in GitHub Desktop.
Basic ReactJS and Django config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i -D @babel/core babel-loader @babel/preset-env @babel/preset-react babel-plugin-transform-class-properties | |
npm i react react-dom | |
npm i webpack webpack-cli | |
.babelrc: | |
{ | |
"presets": ["@babel/preset-env", "@babel/preset-react"], | |
"plugins": ["transform-class-properties"] | |
} | |
webpack.config.js: | |
module.exports ={ | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader : "babel-loader" | |
} | |
} | |
] | |
} | |
}; | |
package.json: | |
"dev": "webpack --mode development ./django_react/frontend/src/index.js --output ./django_react/frontend/main.js" | |
"build": "webpack --mode production ./django_react/frontend/src/index.js --output ./django_react/frontend/main.js" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment