Make sure katex styles are shipped under root of

Also copies of just the katex css we need instead of bundling the entire module
pull/119160/head
Matt Bierner 2021-03-16 17:43:52 -07:00
parent 581a659d42
commit fc8d7681c4
5 changed files with 25 additions and 9 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ Thumbs.db
node_modules/
.build/
extensions/**/dist/
extensions/notebook-markdown-extensions/notebook-out/**
/out*/
/extensions/**/out/
src/vs/server

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@ declare const extendMarkdownIt: undefined | (
(f: (md: markdownIt.MarkdownIt) => void) => void
);
const styleHref = (document.currentScript as any).src.replace('notebook-out/katex.js', 'node_modules/katex/dist/katex.min.css');
const styleHref = (document.currentScript as any).src.replace(/katex.js$/, 'katex.min.css');
const link = document.createElement('link');
link.rel = 'stylesheet';

View File

@ -31,15 +31,14 @@
"scripts": {
"compile": "npm run build-notebook",
"watch": "npm run build-notebook",
"build-notebook": "npx webpack-cli --config webpack.notebook.js --mode production"
},
"dependencies": {
"@iktakahiro/markdown-it-katex": "^4.0.1",
"markdown-it-emoji": "^2.0.0"
"build-notebook": "npx webpack-cli --config webpack.notebook.js --mode production",
"postinstall": "npm run build-notebook"
},
"devDependencies": {
"@iktakahiro/markdown-it-katex": "^4.0.1",
"@types/markdown-it": "^0.0.0",
"markdown-it": "^12.0.4"
"markdown-it": "^12.0.4",
"markdown-it-emoji": "^2.0.0"
},
"repository": {
"type": "git",

View File

@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
@ -23,5 +24,20 @@ module.exports = {
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'notebook-out')
}
},
plugins: [
// @ts-ignore
new CopyPlugin({
patterns: [
{
from: './node_modules/katex/dist/katex.min.css',
to: 'katex.min.css'
},
{
from: './node_modules/katex/dist/fonts',
to: 'fonts/'
},
],
}),
]
};