-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update build and demo files drop old babel config
- Loading branch information
Showing
7 changed files
with
205 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env" | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": "> 0.25%, not dead", | ||
"useBuiltIns": "usage", | ||
"corejs": "3.18", | ||
} | ||
] | ||
} | ||
], | ||
"exclude": [ | ||
"node_modules/**" | ||
], | ||
"plugins": [ | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-syntax-jsx", | ||
[ | ||
"@babel/plugin-transform-react-jsx", | ||
{ | ||
"pragma": "MotorCortex.utils.createDOMElement" | ||
} | ||
] | ||
] | ||
} |
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
Empty file.
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,46 +1,54 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
|
||
const dcPath = "https://code.donkeyclip.com"; | ||
|
||
module.exports = { | ||
entry: "./demo/index.js", | ||
resolve: { | ||
extensions: [".js"], | ||
modules: [path.resolve("./"), "node_modules"], | ||
fallback: { | ||
fs: false, | ||
path: require.resolve("path-browserify"), | ||
}, | ||
}, | ||
context: path.resolve(__dirname), | ||
|
||
entry: "./index.js", | ||
|
||
output: { | ||
filename: "bundle.js", | ||
path: path.resolve(__dirname, "./"), | ||
// the output bundle | ||
filename: "./bundle.js", | ||
}, | ||
mode: "development", | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js?$/, | ||
use: ["babel-loader"], | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
{ | ||
test: /\.svg$/, | ||
loader: "svg-inline-loader", | ||
}, | ||
{ | ||
test: /\.html$/i, | ||
loader: "html-loader", | ||
test: /\.js$/, | ||
use: "babel-loader", | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
|
||
plugins: [ | ||
// enable HMR globally | ||
new webpack.HotModuleReplacementPlugin(), | ||
|
||
// do not emit compiled assets that include errors | ||
new webpack.NoEmitOnErrorsPlugin(), | ||
], | ||
|
||
devServer: { | ||
host: "0.0.0.0", | ||
port: 8080, | ||
host: "127.0.0.1", | ||
port: 8090, | ||
historyApiFallback: false, | ||
hot: false, | ||
static: "./demo", | ||
hot: true, | ||
contentBase: "./demo", | ||
open: true, | ||
openPage: dcPath, | ||
headers: { | ||
"Access-Control-Allow-Origin": dcPath, | ||
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS", | ||
"Access-Control-Allow-Headers": | ||
"X-Requested-With, content-type, Authorization", | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.