Skip to content

Commit

Permalink
add webpack + chrono node for better date/time fields
Browse files Browse the repository at this point in the history
  • Loading branch information
brookgagnon committed Jun 11, 2024
1 parent 30dbbf6 commit 095df1f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ vendor
node_modules
package-lock.json
.php-cs-fixer.cache
bundles
4 changes: 4 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@
<exclude-pattern>*/updates/updates\.php$</exclude-pattern>
<exclude-pattern>*/classes/obfcallbacks\.php$</exclude-pattern>
</rule>

<rule ref=".phpcs/NoModelCallSniff.php">
<exclude-pattern>*/updates/*.php$</exclude-pattern>
</rule>
</ruleset>
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
"dependencies": {
"chrono-node": "^2.7.6",
"htm": "^3.1.1",
"jquery": "^3.6.1",
"jquery-migrate": "^3.4.0",
"sass": "^1.69.5"
},
"devDependencies": {
"video.js": "^8.10.0"
"video.js": "^8.10.0",
"webpack": "^5.92.0",
"webpack-cli": "^5.1.4"
},
"scripts": {
"build": "webpack --config webpack.config.js",
"postinstall": "npm run build"
}
}
12 changes: 12 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path');

module.exports = {
mode: 'production',
entry: './node_modules/chrono-node/dist/esm/index.js', // path to chrono-node
output: {
filename: 'chrono-bundle.js', // the name of the bundled output file
path: path.resolve(__dirname, 'bundles'), // directory where the output file should be stored
library: 'chrono', // the name of the global variable under which the library will be accessible
libraryTarget: 'umd', // makes the library compatible with different environments (e.g., CommonJS, AMD, global)
},
};

0 comments on commit 095df1f

Please sign in to comment.