mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Use webpack to create a CommonJS module from micromark's ESM implementation, convert to using that.
This commit is contained in:
parent
5038f6e154
commit
bb0aa012b5
6 changed files with 57 additions and 5 deletions
3
micromark/.npmignore
Normal file
3
micromark/.npmignore
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
exports.mjs
|
||||
micromark.dev.js
|
||||
webpack.config.js
|
||||
|
|
@ -2,7 +2,8 @@
|
|||
"name": "markdownlint-micromark",
|
||||
"version": "0.1.0",
|
||||
"description": "A trivial package that re-exports some micromark functionality as a CommonJS module",
|
||||
"exports": "./exports.mjs",
|
||||
"type": "commonjs",
|
||||
"exports": "./micromark.js",
|
||||
"author": "David Anson (https://dlaa.me/)",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/DavidAnson/markdownlint",
|
||||
|
|
@ -11,10 +12,17 @@
|
|||
"url": "https://github.com/DavidAnson/markdownlint.git"
|
||||
},
|
||||
"bugs": "https://github.com/DavidAnson/markdownlint/issues",
|
||||
"scripts": {
|
||||
"build": "webpack --no-stats"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"micromark": "3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webpack": "5.75.0",
|
||||
"webpack-cli": "5.0.1"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
micromark/webpack.config.js
Normal file
34
micromark/webpack.config.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// @ts-check
|
||||
|
||||
"use strict";
|
||||
|
||||
const shared = {
|
||||
"entry": "./exports.mjs",
|
||||
"output": {
|
||||
"library": {
|
||||
"type": "commonjs"
|
||||
},
|
||||
"path": __dirname
|
||||
},
|
||||
"target": "node"
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
...shared,
|
||||
"mode": "production",
|
||||
"output": {
|
||||
...shared.output,
|
||||
"filename": "micromark.js"
|
||||
}
|
||||
},
|
||||
{
|
||||
...shared,
|
||||
"devtool": false,
|
||||
"mode": "development",
|
||||
"output": {
|
||||
...shared.output,
|
||||
"filename": "micromark.dev.js"
|
||||
}
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue