WIP: ES6 module conversion and webpack refactoring
- Convert all IIFE modules to ES6 modules with attach functions - Split webpack configs: lib build vs demo build - Add UMD wrapper for auto-initialization with jQuery - Update package.json with sequential build scripts - Clean up legacy dist files and reorganize demo structure Status: jQuery timing issues remain - attach functions not accessible Next: Debug UMD factory execution and jQuery parameter passing
This commit is contained in:
35
webpack.demo.js
Normal file
35
webpack.demo.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const path = require("path");
|
||||
|
||||
// Demo bundle (for demo only, not part of the library)
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: "./demo/demo.js",
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, "demo/dist"), // Place in demo/dist folder
|
||||
filename: "[name].js", // app.js
|
||||
clean: true // Clean the demo/dist directory before emit
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
jquery: path.resolve(__dirname, "node_modules/jquery"),
|
||||
bootstrap: path.resolve(__dirname, "node_modules/bootstrap"),
|
||||
dist: path.resolve(__dirname, "dist")
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ["style-loader", "css-loader"]
|
||||
},
|
||||
{
|
||||
test: /\.(woff|woff2|eot|ttf|svg)$/,
|
||||
type: "asset/resource",
|
||||
generator: {
|
||||
filename: "fonts/[name][ext]"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user