mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 05:50:11 +01:00
Add webpack as part of the smoketest
This commit is contained in:
parent
423a55b305
commit
dfe35b15bb
14 changed files with 57 additions and 41 deletions
|
|
@ -1,2 +1,3 @@
|
|||
/scripts/
|
||||
/src/
|
||||
/test/
|
||||
/smoketest/
|
||||
|
|
|
|||
|
|
@ -5,11 +5,12 @@
|
|||
"main": "out/index.js",
|
||||
"typings": "./out/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "node ./node_modules/webpack/bin/webpack.js --config test/webpack.config.js --progress",
|
||||
"smoketest": "node ./node_modules/webpack/bin/webpack.js --config smoketest/webpack.config.js --progress",
|
||||
"test-cross-origin": "node ./node_modules/webpack/bin/webpack.js --config test/webpack-cross-origin.config.js --progress",
|
||||
"watch": "tsc -w -p tsconfig.json",
|
||||
"compile": "tsc -p tsconfig.json",
|
||||
"import-editor": "node ./scripts/import-editor.js",
|
||||
"prepublishOnly": "tsc -p tsconfig.json"
|
||||
"prepublishOnly": "npm run compile"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
4
webpack-plugin/smoketest/index.js
Normal file
4
webpack-plugin/smoketest/index.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
|
||||
// expose the monaco API as a global for tests
|
||||
window.monacoAPI = monaco;
|
||||
|
|
@ -1,17 +1,19 @@
|
|||
const MonacoWebpackPlugin = require('../out/index.js');
|
||||
const path = require('path');
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
entry: './index.js',
|
||||
context: __dirname,
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
path: path.resolve(REPO_ROOT, 'test/smoke/webpack/out'),
|
||||
filename: 'app.js'
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'monaco-editor': path.resolve(__dirname, '../../release')
|
||||
'monaco-editor': path.resolve(REPO_ROOT, 'release')
|
||||
}
|
||||
},
|
||||
module: {
|
||||
|
|
@ -28,7 +30,7 @@ module.exports = {
|
|||
},
|
||||
plugins: [
|
||||
new MonacoWebpackPlugin({
|
||||
monacoEditorPath: path.resolve(__dirname, '../../release')
|
||||
monacoEditorPath: path.resolve(REPO_ROOT, 'release')
|
||||
})
|
||||
]
|
||||
};
|
||||
13
webpack-plugin/test/dist/index.html
vendored
13
webpack-plugin/test/dist/index.html
vendored
|
|
@ -1,13 +0,0 @@
|
|||
<!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>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
|
||||
monaco.editor.create(document.getElementById('container'), {
|
||||
value: 'console.log("Hello, world")',
|
||||
language: 'javascript'
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue