Skip to content

Commit

Permalink
fix: fix broken webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdor committed Oct 21, 2021
1 parent 300a5f0 commit 9a4b064
Show file tree
Hide file tree
Showing 6 changed files with 11,280 additions and 31,782 deletions.
24 changes: 23 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +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"
}
]
]
}
32 changes: 25 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"parser": "babel-eslint",
"extends": ["eslint:recommended", "prettier"],
"plugins": ["babel", "prettier"],
"parser": "@babel/eslint-parser",
"extends": [
"eslint:recommended",
"prettier"
],
"plugins": [
"babel",
"prettier"
],
"env": {
"browser": true,
"node": true
Expand All @@ -19,13 +25,25 @@
"sinon": true
},
"rules": {
"prettier/prettier": ["error"],
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"prettier/prettier": [
"error"
],
"linebreak-style": [
"error",
"unix"
],
"semi": [
"error",
"always"
],
"no-console": [
"error",
{
"allow": ["warn", "error", "info"]
"allow": [
"warn",
"error",
"info"
]
}
],
"prefer-promise-reject-errors": "error",
Expand Down
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
59 changes: 33 additions & 26 deletions demo/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
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,
static: path.join(__dirname),
open: 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 9a4b064

Please sign in to comment.