Add simple way to test (#12)

pull/2748/head
Alex Dima 2018-05-18 14:48:27 +02:00
parent ff60cf8b84
commit 900e817512
8 changed files with 6196 additions and 741 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
/node_modules/
/test/node_modules/
/test/dist/*.js

1
.npmignore 100644
View File

@ -0,0 +1 @@
/test/

6876
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,13 @@
"homepage": "https://github.com/Microsoft/monaco-editor-webpack-plugin#readme",
"peerDependencies": {
"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 100644
View 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 100644
View File

@ -0,0 +1,7 @@
import * as monaco from 'monaco-editor';
monaco.editor.create(document.getElementById('container'), {
value: 'console.log("Hello, world")',
language: 'javascript'
});

View 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"
}
}

View 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()
]
};