mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Add simple way to test (#12)
This commit is contained in:
parent
ff60cf8b84
commit
900e817512
8 changed files with 6196 additions and 741 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1 +1,3 @@
|
||||||
/node_modules/
|
/node_modules/
|
||||||
|
/test/node_modules/
|
||||||
|
/test/dist/*.js
|
||||||
|
|
|
||||||
1
.npmignore
Normal file
1
.npmignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/test/
|
||||||
6876
package-lock.json
generated
6876
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -24,6 +24,13 @@
|
||||||
"homepage": "https://github.com/Microsoft/monaco-editor-webpack-plugin#readme",
|
"homepage": "https://github.com/Microsoft/monaco-editor-webpack-plugin#readme",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"webpack": "^4.5.0",
|
"webpack": "^4.5.0",
|
||||||
"monaco-editor": "^0.12.0"
|
"monaco-editor": "^0.13.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"css-loader": "^0.28.11",
|
||||||
|
"monaco-editor": "^0.13.1",
|
||||||
|
"style-loader": "^0.21.0",
|
||||||
|
"webpack": "^4.6.0",
|
||||||
|
"webpack-cli": "^2.0.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
test/dist/index.html
vendored
Normal file
13
test/dist/index.html
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container" style="width:800px;height:600px;border:1px solid #ccc"></div>
|
||||||
|
<script type="text/javascript" src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
test/index.js
Normal file
7
test/index.js
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
import * as monaco from 'monaco-editor';
|
||||||
|
|
||||||
|
monaco.editor.create(document.getElementById('container'), {
|
||||||
|
value: 'console.log("Hello, world")',
|
||||||
|
language: 'javascript'
|
||||||
|
});
|
||||||
9
test/package.json
Normal file
9
test/package.json
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "monaco-webpack-test",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "../node_modules/.bin/webpack --config webpack.config.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
20
test/webpack.config.js
Normal file
20
test/webpack.config.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
const MonacoWebpackPlugin = require('../index.js');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
mode: 'development',
|
||||||
|
entry: './index.js',
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
filename: 'app.js'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: ['style-loader', 'css-loader']
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new MonacoWebpackPlugin()
|
||||||
|
]
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue