@cocreate/conditional-logic
Advanced tools
Comparing version
{ | ||
"name": "@cocreate/conditional-logic", | ||
"version": "1.12.1", | ||
"version": "1.12.2", | ||
"description": "Simple JS component show & hide elements conditionally with inputs,checkbox,radio,btn etc.Great for creating tabs, accordions, dynamic forms, etc. Easy Configuration using HTML5 data attributes and/or JavaScript API.", | ||
@@ -48,10 +48,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"babel-loader": "^8.1.0", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"file-loader": "^6.2.0", | ||
"css-loader": "^5.1.3", | ||
"esbuild": "^0.25.2", | ||
"esbuild-loader": "^4.3.0", | ||
"mini-css-extract-plugin": "^1.5.0", | ||
"style-loader": "^3.3.1", | ||
"terser-webpack-plugin": "^5.1.1", | ||
"webpack": "^5.24.4", | ||
@@ -62,6 +58,6 @@ "webpack-cli": "^4.5.0", | ||
"dependencies": { | ||
"@cocreate/actions": "^1.18.2", | ||
"@cocreate/observer": "^1.16.1", | ||
"@cocreate/utils": "^1.33.7" | ||
"@cocreate/actions": "^1.21.0", | ||
"@cocreate/observer": "^1.18.0", | ||
"@cocreate/utils": "^1.38.0" | ||
} | ||
} |
@@ -1,90 +0,65 @@ | ||
const path = require("path") | ||
const TerserPlugin = require("terser-webpack-plugin") | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin") | ||
const { CleanWebpackPlugin } = require("clean-webpack-plugin") | ||
const path = require("path"); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const { EsbuildPlugin } = require("esbuild-loader"); | ||
const { FileUploader } = require("@cocreate/webpack"); | ||
module.exports = (env, argv) => { | ||
let isProduction = false | ||
if (argv.mode === 'production') | ||
isProduction = true | ||
const config = { | ||
entry: { | ||
"CoCreate-conditional-logic": "./src/index.js", | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: isProduction ? "[name].min.js" : "[name].js", | ||
libraryTarget: "umd", | ||
libraryExport: "default", | ||
library: ["CoCreate", "conditionalLogic"], | ||
globalObject: "this", | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin(), | ||
new MiniCssExtractPlugin({ | ||
filename: "[name].css", | ||
}), | ||
], | ||
// Default mode for Webpack is production. | ||
// Depending on mode Webpack will apply different things | ||
// on final bundle. For now we don't need production's JavaScript | ||
// minifying and other thing so let's set mode to development | ||
mode: isProduction ? "production" : "development", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /.js$/, | ||
exclude: /(node_modules)/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
plugins: ["@babel/plugin-transform-modules-commonjs"], | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /.css$/i, | ||
use: [ | ||
{ loader: "style-loader", options: { injectType: "linkTag" } }, | ||
"file-loader", | ||
], | ||
}, | ||
], | ||
}, | ||
// add source map | ||
...(isProduction ? {} : { devtool: "eval-source-map" }), | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
extractComments: true, | ||
// cache: true, | ||
parallel: true, | ||
// sourceMap: true, // Must be set to true if using source-maps in production | ||
terserOptions: { | ||
// https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions | ||
// extractComments: 'all', | ||
compress: { | ||
drop_console: true, | ||
}, | ||
}, | ||
}), | ||
], | ||
splitChunks: { | ||
chunks: "all", | ||
minSize: 200, | ||
// maxSize: 99999, | ||
//minChunks: 1, | ||
cacheGroups: { | ||
defaultVendors: false, | ||
}, | ||
}, | ||
}, | ||
} | ||
return config | ||
} | ||
module.exports = async (env, argv) => { | ||
const isProduction = argv && argv.mode === "production"; | ||
const config = { | ||
entry: { | ||
"CoCreate-conditional-logic": "./src/index.js" | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, "dist"), | ||
filename: isProduction ? "[name].min.js" : "[name].js", | ||
libraryExport: "default", | ||
library: ["CoCreate", "conditionalLogic"], | ||
clean: true | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
filename: isProduction ? "[name].min.css" : "[name].css" | ||
}), | ||
new FileUploader(env, argv) | ||
], | ||
mode: isProduction ? "production" : "development", | ||
devtool: isProduction ? "source-map" : "eval-source-map", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "esbuild-loader", | ||
options: { | ||
loader: "js", | ||
target: "es2017" | ||
} | ||
} | ||
}, | ||
{ | ||
test: /.css$/i, | ||
use: [MiniCssExtractPlugin.loader, "css-loader"] | ||
} | ||
] | ||
}, | ||
optimization: { | ||
minimize: isProduction, | ||
minimizer: [ | ||
new EsbuildPlugin({ | ||
target: "es2017", | ||
css: true | ||
}) | ||
], | ||
splitChunks: { | ||
cacheGroups: { | ||
defaultVendors: false | ||
} | ||
} | ||
}, | ||
performance: { | ||
hints: isProduction ? "warning" : false | ||
} | ||
}; | ||
return config; | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
7
-36.36%107482
-2.7%270
-6.57%Updated
Updated
Updated