Skip to content

Commit

Permalink
fix: update build and demo files drop old babel config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdor committed Oct 20, 2021
1 parent 6aeef41 commit f4c2e4f
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 125 deletions.
26 changes: 23 additions & 3 deletions .babelrc
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"
}
]
]
}
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"extends": [
"eslint:recommended",
"prettier"
Expand Down Expand Up @@ -57,4 +57,4 @@
"no-var": "error",
"no-unused-vars": "error"
}
}
}
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
60 changes: 34 additions & 26 deletions demo/webpack.config.js
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",
},
},
};
Loading

0 comments on commit f4c2e4f

Please sign in to comment.