1 Star 0 Fork 0

羽天 / reactide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
Pablo Lee 提交于 2018-11-20 12:23 . reactide v.2 beta
const path = require('path');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = {
entry: './renderer/index.js',
output: {
globalObject: 'self',
path: path.resolve(__dirname, 'dist'),
filename: 'webpack-bundle.js',
publicPath: '../dist/',
},
// Compile for Electron for main process.
target: 'electron-main',
// configure whether to polyfill or mock certain Node.js globals
node: {
__dirname: false,
__filename: false
},
module: {
rules: [
{
test: /\.worker\.js$/,
exclude: /node_modules/,
use: {
loader: 'worker-loader',
options: {
name: '[name].js',
},
},
},
{
test: /\.css$/,
use:
process.env.NODE_ENV === 'production'
? [MiniCssExtractPlugin.loader, 'css-loader']
: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: [
"style-loader", // creates style nodes from JS strings
"css-loader", // translates CSS into CommonJS
"sass-loader" // compiles Sass to CSS, using Node Sass by default
]
},
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /(node_modules|(vendor\/.+.bundle\.js))/,
query: {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
}
]
},
plugins: [
new MonacoWebpackPlugin()
],
devServer: {
port: 8081
}
}
JavaScript
1
https://gitee.com/nboss/reactide.git
git@gitee.com:nboss/reactide.git
nboss
reactide
reactide
master

搜索帮助