webpack.common.js

43 lines | 1.347 kB Blame History Raw Download
const path = require('path');
module.exports = {
    entry: {
        'main': path.resolve(__dirname, 'codeeditor-app', 'boot.ts'),
        'editor.worker': 'monaco-editor/esm/vs/editor/editor.worker.js',
		'json.worker': 'monaco-editor/esm/vs/language/json/json.worker',
		'css.worker': 'monaco-editor/esm/vs/language/css/css.worker',
		'html.worker': 'monaco-editor/esm/vs/language/html/html.worker',
		'ts.worker': 'monaco-editor/esm/vs/language/typescript/ts.worker',
        '../outputframe/output.frame': path.resolve(__dirname, 'outputframe-app', 'boot.ts')
    },
    resolve: {
        extensions: [".ts", ".js", ".json"]
    },
    module: {
        rules: [
            {
                test: /\.txt$/,
                use: 'raw-loader'
            },
            {
                //ts to js
                test: /\.ts$/,
                use: 'ts-loader'
            },
            {
                //html to js
                test: /\.html$/,
                use: 'html-loader'
            },
            {
                //css to js to inline style append
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                //less to css to js to inline style append
                test: /\.less$/,
                use: ['style-loader', 'css-loader', 'less-loader']
            }
        ]
    }
};