代码拉取完成,页面将自动刷新
同步操作将从 曾勇/web-editor-markdown 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
mode: 'development',
output: {
filename: '[name]',
path: path.resolve(__dirname, './dist'),
},
entry: {
'index.js': './demo/index.ts',
},
devtool:'eval-source-map',
resolve: {
extensions: ['.js', '.ts', 'less', '.png', '.scss'],
},
module: {
rules: [
{
test: /\.less$/,
include: [path.resolve(__dirname, 'src')],
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader', // translates CSS into CommonJS
options: {
url: false,
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
['autoprefixer', {grid: true, remove: false}],
],
},
},
},
{
loader: 'less-loader', // compiles Sass to CSS
},
],
},
{
test: /\.scss$/,
include: [path.resolve(__dirname, 'src')],
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader', // translates CSS into CommonJS
options: {
url: false,
},
},
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
['autoprefixer', {grid: true, remove: false}],
],
},
},
},
{
loader: 'sass-loader', // compiles Sass to CSS
},
],
},
{
test: /\.ts$/,
use: 'ts-loader',
},
{
test: /\.js$/,
exclude: '/node_modules/',
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/env',
{
targets: {
browsers: [
'last 2 Chrome major versions',
'last 2 Firefox major versions',
'last 2 Safari major versions',
'last 2 Edge major versions',
'last 2 iOS major versions',
'last 2 ChromeAndroid major versions',
],
},
},
],
],
},
},
},
// {
// test: /\.png$/,
// include: [path.resolve(__dirname, './src/assets/images')],
// use: [
// 'file-loader',
// ],
// },
],
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['index.js'],
filename: './index.html',
template: './demo/index.html',
}),
// new CopyPlugin({
// patterns: [
// // {from: 'src/css', to: 'css'},
// // {from: 'src/images', to: 'images'},
// {from: 'src/js', to: 'js'}
// ],
// }),
],
devServer: {
static: {
directory: path.join(__dirname, '.'),
},
port: 9001,
host: 'localhost',
proxy: {
'/api': {
target: 'http://localhost:8080',
pathRewrite: {'^/api': ''},
},
},
},
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。