
- Create demo folder and move test files with proper naming - Rename test.html/js/php to demo/index.html/demo.js/demo.php - Update Gruntfile.js to Bootstrap 5 only configuration - Clean up package.json dependencies (remove unused webpack/popper.js) - Remove non-Bootstrap 5 dist directories - Update webpack config to use demo files - Fix demo paths and ensure fully functional demo
74 lines
2.5 KiB
JavaScript
74 lines
2.5 KiB
JavaScript
const webpack = require("webpack");
|
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
const path = require("path");
|
|
|
|
module.exports = [
|
|
// Main bundle (jQuery, Bootstrap, App)
|
|
{
|
|
entry: {
|
|
jquery: "jquery",
|
|
app: "./demo/demo.js",
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"), // Place them directly in dist/
|
|
filename: "[name].js", // app.js, jquery.js, bootstrap.js
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
jquery: path.resolve(__dirname, "node_modules/jquery"),
|
|
bootstrap: path.resolve(__dirname, "node_modules/bootstrap"),
|
|
"bootstrap5-editable": path.resolve(__dirname, "dist/bootstrap5-editable")
|
|
}
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", "css-loader"]
|
|
},
|
|
{
|
|
test: /\.(woff|woff2|eot|ttf|svg)$/,
|
|
type: "asset/resource",
|
|
generator: {
|
|
filename: "fonts/[name][ext]"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
$: "jquery",
|
|
jQuery: "jquery",
|
|
"window.jQuery": "jquery",
|
|
bootstrap: "bootstrap",
|
|
"window.bootstrap": "bootstrap"
|
|
}),
|
|
new CopyWebpackPlugin({
|
|
patterns: [
|
|
{ from: "src/editable-form/editable-form.css", to: path.resolve(__dirname, "dist/bootstrap5-editable/css") },
|
|
{ from: "node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css", to: path.resolve(__dirname, "dist/bootstrap5-editable/css") },
|
|
{ from: "node_modules/bootstrap-icons/font/fonts", to: path.resolve(__dirname, "dist/fonts") }
|
|
]
|
|
})
|
|
]
|
|
},
|
|
|
|
// X-Editable Plugin (Bootstrap 5)
|
|
{
|
|
entry: "./src/bootstrap5-editable.js",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist/bootstrap5-editable/js"), // X-Editable stays here
|
|
filename: "bootstrap-editable.js",
|
|
library: {
|
|
name: "EditableForm",
|
|
type: "umd"
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
jquery: path.resolve(__dirname, "node_modules/jquery"),
|
|
bootstrap: path.resolve(__dirname, "node_modules/bootstrap")
|
|
}
|
|
}
|
|
}
|
|
]; |