E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
module.exports
【前端】CommonJS和ES Module
区别语法差异:CommonJS:使用require()导入模块,使用
module.exports
或exports导出模块。ESModule:使用import导入模块,使用export导出模块。
Lucky小维
·
2024-03-25 05:51
前端
前端
commonjs和esmodule
commonjs的模块导出和引用写法:lib.js导出一个模块leta=1letb=2functionaPlus1(){returna++}
module.exports
={a,b,aPlus1}index.js
Repeater、
·
2024-03-16 15:22
javascript
前端
开发语言
JS 之export、export default和
module.exports
export和exportdefault是ES6中导出模块中变量的语法exports和
module.exports
是Nodejs中导出模块中变量的语法(基于CommonJs语法规范)【export】--
刘_小_二
·
2024-03-15 11:08
移动端适配方案 postcss-px-to-viewport
安装npminstallpostcss-px-to-viewport--save-dev或yarnadd-Dpostcss-px-to-viewport根目录下新建postcss.config.js文件
module.exports
有没有认真工作
·
2024-03-12 21:43
postcss
javascript
前端
Node.js基础---使用Express写接口
.创建基本的服务器2.创建API路由模块//aoiRouter.js路由模块constexpress=require('express')constapiRouter=express.Router()
module.exports
爱健身的小刘同学
·
2024-03-11 22:10
node.js
node.js
express
Vue-Quill-Editor 简单修改字体大小和样式.(不改源码)
npminstallvue-quill-editor--save需要在根目录下的vue.config.js文件里,添加如下chainWebpack:constwebpack=require('webpack')
module.exports
十里冰香
·
2024-02-29 09:18
富文本
quill
微信小程序-蓝牙功能
这个比较简单直接上代码
module.exports
=Behavior({//全局datadata:{espdeviceId:'9F06627E-3BFF-0CB2-D41C-DBCA272DC633',
飞奔的裸羊羊
·
2024-02-24 21:34
微信小程序
notepad++
小程序
nodejs的Connection lost: The server closed the connection
数据库配置的基础信息
module.exports
={host:'localhost',user:'root',password:'root',database:'association',port:3306
capricious_1612
·
2024-02-20 22:23
webpack使用babel-loader编译ES新特性
以及配置二、测试效果一、安装babel-loader以及配置yarnaddbabel-loader@babel/
[email protected]
配置
module.exports
火鸡面多放火鸡
·
2024-02-20 18:48
模块化
打包工具
webpack
javascript
JS模块化系统
//模块导出
module.exports
={//模块内容};//模块导入constmodule=require('module');top
·
2024-02-20 15:25
【Webpack】处理图片资源
file-loader和url-loader进行处理现在Webpack5已经将两个Loader功能内置到Webpack里了,我们只需要简单配置即可处理图片资源1.配置constpath=require("path");
module.exports
小秀_heo
·
2024-02-20 04:30
Webpack
webpack
rust
前端
JS模块化系统
//模块导出
module.exports
={//模块内容};//模块导入constmodule=require('module');top
·
2024-02-19 11:41
手机端vue+vant+rem项目适配750px设计稿的配置
很是苦恼,经过一番搜索,按照如下配置.postcssrc.js文件,就可以完美解决问题
module.exports
=({file})=>{letisVant=file&&file.dirname
伍佰2017
·
2024-02-14 21:13
vue cli 3 build 打包之后路径错误问题,出现空白页
解决思路:在src文件夹同级目录下创建vue.config.js文件在vue.config.js中重写打包后的基础路径为当前目录
module.exports
={//...baseUrl:'./'//..
王冥
·
2024-02-14 05:36
Nuxt开发的网站如何部署到线上服务器
一、在工程的根目录增加ecosystem.config.js文件1.pm2的配置文件,pm2启动的时候会自动读取该配置
module.exports
={apps:[{name:'your-name',//
周星星的学习笔记
·
2024-02-14 01:06
【ES6】模块化
nodejs遵循了CommonJs的模块化规范导入require()导出
module.exports
模块化的好处:模块化可以避免命名冲突的问题大家都遵循同样的模块化写代码,降低了沟通的成本,极大方便了各个模块之间的相互调用需要啥模块
倒霉娃不要倒霉
·
2024-02-12 21:41
es6
前端
ecmascript
ERROR Invalid options in vue.config.js: “baseUrl“ is not allowed
改成
module.exports
={publicPath:process.env.NODE_ENV==='producti
家乡_a6ce
·
2024-02-11 16:33
微信小程序api的封装使用
request3.创建api文件4.引用1.设置访问baseUrl在static文件夹(static文件夹是用来放置图片等资源的文件夹)中新建config.js文件,设置baseUrlconfig.js文件
module.exports
你说啥???
·
2024-02-11 14:33
微信小程序
前端
微信小程序
UNI-APP 一些常用方法
module.exports
={//判断是IOS还是安卓getPhoneType(){vartype='other'switch(uni.getSystemInfoSync().platform){case'android
开飞机的杰瑞
·
2024-02-10 18:15
vue移动端适配(px转vw)postcss-px-to-viewport配置 安装postcss-px-to-viewport
npminstallpostcss-px-to-viewport//postcss.config.js文件
module.exports
={plugins:{'postcss-px-to-viewport
如饥似渴的人
·
2024-02-10 11:30
express提取出路由模块创建http服务
最开始一般会想到通过模块内置对象
module.exports
导出,app.js进行导入://router.jsmodule.exports=fu
chen_cheng
·
2024-02-10 09:19
ESLint & prettier 配置代码风格
https://prettier.io使用单引号不使用分号每行宽度至多80字符不加对象|数组最后逗号换行符号不限制(winmac不一致)vue组件名称多单词组成(忽略index.vue)props解构(关闭)
module.exports
程序员iteng
·
2024-02-09 19:11
前端
vue.js
javascript
前端
ES6模块与CommonJS的区别
CommonJs模块输出的是值的拷贝,也就是说,一旦输出一个值,模块内部的变化不会影响到这个值//common.jsvarcount=1;varprintCount=()=>{return++count;}
module.exports
南蓝NL
·
2024-02-08 21:03
webpack.config.js和vue.config.js
path')const{VueLoaderPlugin}=require('vue-loader')constHtmlWebpackPlugin=require('html-webpack-plugin')
module.exports
辉娜
·
2024-02-08 20:28
vue
webpack
javascript
vue.js
Vue vue-config.js(字段属性详细介绍)
通过官方文档vue-cli进行的总结
module.exports
={//部署应用包时的基本url。
卡尔特斯
·
2024-02-08 20:28
Vue2.x
vue
vue.js
webpack概念
cddemonpminstall-Dwebpackwebpack-cli创建一个webpack.config.js文件,webpack配置可以写在其中constpath=require('path')
module.exports
passenger_z
·
2024-02-08 13:43
vue项目打包时如何去除文件的hash值?
vue.config.js:const{defineConfig}=require('@vue/cli-service')
module.exports
=def
徐同保
·
2024-02-08 06:10
web前端
vue.js
前端
javascript
使用electron将VUE项目打包成.exe文件
gitclonehttps://github.com/electron/electron-quick-start//安装依赖npmi二、安装依赖后,对打包项目进行配置1、修改vue.config.js文件
module.exports
s_Myint
·
2024-02-07 10:15
electron
vue.js
redux
通过创建一个函数,返回一个对象,一定要携带type属性action/index.jsconstsendAction=()=>{return{type:'send_type',value:'我是一个action'}}
module.exports
Ace__丨
·
2024-02-07 07:25
Vue代理模式和Nginx反向代理(Vue代理部署不生效)
为了解决跨域问题,可以在vue.config.js文件中配置代理:const{defineConfig}=require('@vue/cli-service')
module.exports
=defineConfig
Major_xx
·
2024-02-07 06:07
前端
vue.js
代理模式
nginx
react中jest配置,解决node_modules报错esm无法解析的问题
(css|less|scss|sss|styl)$":"jest-css-modules"}并安装jest-css-modules(npmi--save-devjest-css-modules)
module.exports
after you
·
2024-02-07 05:35
react.js
前端
前端框架
uni-app---js暴露对象和引用module.exports---require
commom/utils.js//暴露对象constversion="1.0.0"functiongetVersion(){return"getVersion:1.0.0"}
module.exports
光明有我16620122910
·
2024-02-05 13:48
uni-app
javascript
前端
vue.js
vue3.0+vite实现移动端自适应布局
1安装postcss-pxtoremnpmipostcss-pxtorem-D2新建postcss.config.js配置文件
module.exports
={plugins:{autoprefixer:
贵贵贵子
·
2024-02-05 12:47
一知半解,临时解决ajax跨域请求
上网找,说在vue.config.js做配置,加上以下内容:
module.exports
={devServer:{port:8089,proxy:{'/mytest':{target:'http://192.168.0.183
onebigday
·
2024-02-05 11:15
java学习
vue.js
前端
javascript
ajax
console.log导致内存泄露 打包时自动去掉console.log方法
webpack通过工具:terser使用前需要先安装一下vue.config.jsconst{defineConfig}=require('@vue/cli-servise');
module.exports
半兽先生
·
2024-02-05 11:23
前端
vuecli3 执行 npm run build 打包命令报错:TypeError: file.split is not a function
就是执行npmrunbuild命令的时候报错了,如下:解决我排查了一下,模拟代码如下:在打包的时候用了MinChunkSizePluginconstwebpack=require("webpack");
module.exports
凯小默
·
2024-02-05 10:54
Vue
技术栈
vue
vue-cli3.0设置根目录别称
在根目录下新建vue.config.js文件constpath=require('path')functionresolve(dir){returnpath.join(__dirname,dir)}
module.exports
时间的溺水者
·
2024-02-05 03:34
Webpack — 配置(entry&output)
string字符串,表明该项目只有一个入口文件;
module.exports
={//...entry:".
我是小凤凰
·
2024-02-03 23:30
解决Vue项目打包部署后再开发者工具中能看到源代码的问题
项目打包部署后再开发者工具中能看到源代码的问题,步骤如下:1、package.json新增如下配置"vue":{"productionSourceMap":false}2、vueconfig.json新增如下配置
module.exports
西红薯炒番茄
·
2024-02-03 22:13
vue.js
前端
javascript
Vue-cli 3.xx一次性引入Less全局变量
安装:style-resources-loadervueaddstyle-resources-loader然后在vue.config.js中添加constpath=require('path')
module.exports
geeklibin
·
2024-02-03 15:31
node环境打包js,webpack和rollup两个打包工具打包,能支持vue
这篇文章讲解两种打包方式,webpack打包和rollup打包两种方式1、webpack打包js1.1在根目录创建webpack.config.js,配置如下constpath=require('path');
module.exports
guhy fighting
·
2024-02-03 12:08
javascript
webpack
开发语言
使用Vue解决跨域问题
1.创建vue.config.js设置devServer属性
module.exports
={devServer:{//webpack-dev-server配置host:'localhost',port:
勇宝趣学前端
·
2024-02-02 18:53
Vue
vue.js
前端
javascript
JS 模块规范
一、CommonJS规范的核心思想是允许模块通过require方法来同步加载所要依赖的其他模块,然后通过exports或
module.exports
来导出需要暴露的接口。
154396b61865
·
2024-02-02 15:01
前端工程化之:webpack1-10(区分环境)
module.exports
=env=>{return{//配置内容}}在开始构建时,webpack如果发现配置是一个函数,会调用该函数,将函数返回的对象作为配置内容,因此,开发者可以根据不同的环境返回不同的对象
小李老笨了
·
2024-02-02 08:54
前端工程化
前端
webpack
node.js
module exports和exports export和export default的区别
module.exports
/exports:只有node支持的导出(为了避免糊涂,尽量都用
module.exports
导出)export/import:只有es6支持的导出引入require:node
吃不胖的茶叶蛋
·
2024-02-01 18:35
vue.config.js配置代理
importaxiosfrom'axios';constinstance=axios.create{baseURL:'/proxyApi'}...vue.config.js配置代理(提示:配置完成后,重启一下服务,使其生效)
module.exports
怒默
·
2024-02-01 10:17
Node.js + Express 连接 Mysql 数据库
Node.js+Express连接Mysql数据库1、目录结构2、先在根目录下创建db.config.js和db.js文件2.1、db.config.js配置数据库的信息,导出一个模块信息
module.exports
Bug_yellow
·
2024-02-01 10:32
前端
node.js
mysql
node.js
前端
mysql
Feature flag __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is not explicitly defined.
vue.config.js文件中增加VUE_PROD_HYDRATION_MISMATCH_DETAILS:false,const{defineConfig}=require("@vue/cli-service");
module.exports
jugt
·
2024-02-01 04:20
Vue3
Vue
javascript
前端
vue
uniapp 添加本地文件日志 并增加防抖(防止重复写入被覆盖)
module.exports
=factory():typeofdefine==='function'&&defi
风花一世月
·
2024-02-01 01:03
uni-app
javascript
前端
开发语言
ecmascript
Webpack 的使用
bundle.js配置webpack.config.js文件通过Node.js导入pash包使用Node.js前,初始化npmnpminit倒入模块路径constpath=require("path");配置
module.exports
coderlion
·
2024-01-31 15:01
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他