mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-09 09:31:25 +00:00
Merge pull request #69 from remcohaszing/optimize-example
Optimize the example
This commit is contained in:
commit
249771b770
5 changed files with 1941 additions and 30 deletions
|
|
@ -9,10 +9,11 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||||
"css-loader": "^6.2.0",
|
"css-loader": "^6.2.0",
|
||||||
|
"css-minimizer-webpack-plugin": "^3.0.2",
|
||||||
"html-webpack-plugin": "^5.3.2",
|
"html-webpack-plugin": "^5.3.2",
|
||||||
|
"mini-css-extract-plugin": "^2.2.0",
|
||||||
"monaco-editor": "^0.26.1",
|
"monaco-editor": "^0.26.1",
|
||||||
"monaco-yaml": "file:../..",
|
"monaco-yaml": "file:../..",
|
||||||
"style-loader": "^3.2.1",
|
|
||||||
"webpack": "^5.48.0",
|
"webpack": "^5.48.0",
|
||||||
"webpack-cli": "^4.7.2",
|
"webpack-cli": "^4.7.2",
|
||||||
"webpack-dev-server": "^3.11.2"
|
"webpack-dev-server": "^3.11.2"
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ body {
|
||||||
background: var(--background-color);
|
background: var(--background-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
|
font-family: sans-serif;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +35,10 @@ nav {
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-icon {
|
.nav-icon {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-icon > img {
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
|
||||||
|
|
@ -8,17 +8,15 @@
|
||||||
<nav>
|
<nav>
|
||||||
<h1>Monaco YAML</h1>
|
<h1>Monaco YAML</h1>
|
||||||
<div>
|
<div>
|
||||||
<a href="https://npmjs.com/package/monaco-yaml">
|
<a href="https://npmjs.com/package/monaco-yaml" class="nav-icon">
|
||||||
<img
|
<img
|
||||||
alt="npm icon"
|
alt="npm icon"
|
||||||
class="nav-icon"
|
|
||||||
src="<%= require('@fortawesome/fontawesome-free/svgs/brands/npm.svg') %>"
|
src="<%= require('@fortawesome/fontawesome-free/svgs/brands/npm.svg') %>"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/remcohaszing/monaco-yaml">
|
<a href="https://github.com/remcohaszing/monaco-yaml" class="nav-icon">
|
||||||
<img
|
<img
|
||||||
alt="GitHub icon"
|
alt="GitHub icon"
|
||||||
class="nav-icon"
|
|
||||||
src="<%= require('@fortawesome/fontawesome-free/svgs/brands/github.svg') %>"
|
src="<%= require('@fortawesome/fontawesome-free/svgs/brands/github.svg') %>"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
|
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
output: {
|
||||||
|
filename: '[contenthash].js',
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
fallback: {
|
fallback: {
|
||||||
// Yaml-ast-parser-custom-tags imports buffer. This can be omitted safely.
|
// Yaml-ast-parser-custom-tags imports buffer. This can be omitted safely.
|
||||||
|
|
@ -11,7 +16,7 @@ module.exports = {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.css$/,
|
test: /\.css$/,
|
||||||
use: ['style-loader', 'css-loader'],
|
use: [MiniCssExtractPlugin.loader, 'css-loader'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Monaco editor uses .ttf icons.
|
// Monaco editor uses .ttf icons.
|
||||||
|
|
@ -20,5 +25,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [new HtmlWebPackPlugin()],
|
optimization: {
|
||||||
|
minimizer: ['...', new CssMinimizerPlugin()],
|
||||||
|
},
|
||||||
|
plugins: [new HtmlWebPackPlugin(), new MiniCssExtractPlugin({ filename: '[contenthash].css' })],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
1945
package-lock.json
generated
1945
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue