Skip to content

Commit

Permalink
Add simple way to test (microsoft#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed May 18, 2018
1 parent ff60cf8 commit 900e817
Show file tree
Hide file tree
Showing 8 changed files with 6,267 additions and 812 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/node_modules/
/test/node_modules/
/test/dist/*.js
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test/
7,018 changes: 6,207 additions & 811 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 13 additions & 0 deletions test/dist/index.html
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

import * as monaco from 'monaco-editor';

monaco.editor.create(document.getElementById('container'), {
value: 'console.log("Hello, world")',
language: 'javascript'
});
9 changes: 9 additions & 0 deletions test/package.json
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 0 deletions test/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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()
]
};

0 comments on commit 900e817

Please sign in to comment.