-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switched to neutrino * Slimmed down validator.js * Potential fix for multiple babel-plugin-import * Remove craco config * Fixed babel issues with validator.js * Revert envs * Fix packages * Fix local env * Fix linter * Fixed env problem Co-authored-by: Ali Nouri <dynamic11@users.noreply.github.com>
- Loading branch information
Showing
12 changed files
with
2,388 additions
and
3,978 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
const react = require("@neutrinojs/react"); | ||
const jest = require("@neutrinojs/jest"); | ||
const style = require("@neutrinojs/style-loader"); | ||
const antTheme = require("./src/antdTheme"); | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
options: { | ||
root: __dirname, | ||
}, | ||
use: [ | ||
react({ | ||
devServer: { | ||
contentBase: path.join(__dirname, "public"), | ||
host: "0.0.0.0", | ||
port: 3000, | ||
}, | ||
minify: { | ||
source: process.env.NODE_ENV === "production", | ||
}, | ||
html: { | ||
template: "public/index.ejs", | ||
favicon: "public/favicon.ico", | ||
}, | ||
babel: { | ||
plugins: [ | ||
[ | ||
"import", | ||
{ | ||
libraryName: "validator", | ||
libraryDirectory: "es/lib", | ||
camel2DashComponentName: false, | ||
}, | ||
"validator", | ||
], | ||
[ | ||
"import", | ||
{ | ||
libraryName: "antd", | ||
libraryDirectory: "es", | ||
style: true, | ||
}, | ||
"antd", | ||
], | ||
], | ||
}, | ||
style: { | ||
test: /\.(css|scss)$/, | ||
modulesTest: /\.module\.(css|scss)$/, | ||
loaders: [ | ||
{ | ||
loader: "postcss-loader", | ||
options: { | ||
postcssOptions: { | ||
plugins: [require("autoprefixer")], | ||
}, | ||
}, | ||
}, | ||
{ | ||
loader: "sass-loader", | ||
useId: "sass", | ||
}, | ||
], | ||
}, | ||
}), | ||
style({ | ||
test: /\.less/, | ||
modulesTest: /\.module\.less$/, | ||
ruleId: "style-less", | ||
styleUseId: "style-less", | ||
cssUseId: "css-less", | ||
extractId: "extract-less", | ||
loaders: [ | ||
{ | ||
loader: "less-loader", | ||
useId: "less", | ||
options: { | ||
lessOptions: { | ||
modifyVars: antTheme, | ||
javascriptEnabled: true, | ||
}, | ||
}, | ||
}, | ||
], | ||
}), | ||
({ config }) => { | ||
config | ||
.plugin("antd-dayjs") | ||
.use(require.resolve("antd-dayjs-webpack-plugin")); | ||
|
||
if (process.env.NODE_ENV === "production") { | ||
config.optimization | ||
.minimize(true) | ||
.minimizer("terser-plugin") | ||
.use(require.resolve("terser-webpack-plugin")); | ||
config.optimization | ||
.minimize(true) | ||
.minimizer("css-minimizer") | ||
.use(require.resolve("css-minimizer-webpack-plugin")); | ||
} | ||
|
||
if (process.env.ANALYZE_BUILD === "true") { | ||
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer"); | ||
|
||
config.plugin("bundle-analyzer").use(BundleAnalyzerPlugin, [ | ||
{ | ||
analyzerHost: "0.0.0.0", | ||
analyzerPort: 3031, | ||
analyzerMode: "server", | ||
}, | ||
]); | ||
} | ||
}, | ||
jest(), | ||
], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const neutrino = require("neutrino"); | ||
|
||
module.exports = neutrino().babel(); |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const neutrino = require('neutrino'); | ||
|
||
process.env.NODE_ENV = process.env.NODE_ENV || 'test'; | ||
|
||
module.exports = neutrino().jest(); |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { render } from "react-dom"; | ||
import "react-app-polyfill/ie11"; | ||
import "react-app-polyfill/stable"; | ||
import App from "./App"; | ||
|
||
ReactDOM.render(<App />, document.getElementById("root")); | ||
render(<App />, document.getElementById("root")); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Whilst the configuration object can be modified here, the recommended way of making | ||
// changes is via the presets' options or Neutrino's API in `.neutrinorc.js` instead. | ||
// Neutrino's inspect feature can be used to view/export the generated configuration. | ||
const neutrino = require('neutrino'); | ||
|
||
module.exports = neutrino().webpack(); |
Oops, something went wrong.