Webpack

react&webpack使用css、less && 安装原则 --- 从根本上解决问题。

坚强是说给别人听的谎言 提交于 2020-12-29 13:59:39
react&webpack使用css、less && 安装原则 --- 从根本上解决问题。 参考文章: (1)react&webpack使用css、less && 安装原则 --- 从根本上解决问题。 (2)https://www.cnblogs.com/zhuzhenwei918/p/7231418.html 备忘一下。 来源: oschina 链接: https://my.oschina.net/u/4432649/blog/4867939

Import all sass file within directory with webpack

限于喜欢 提交于 2020-12-29 12:32:44
问题 I'm currently trying to use Webpack to bundle all my files and I don't know how to proceed when dealing with multiple folders and .scss files. I used to use grunt to do these tasks, and this is an example of my folder structure: functions - _mixin.scss - _function.scss - [...] variables - _colors.scss - _typo.scss - [...] ui - _button.scss - _grid.scss - [...] view - _home.scss - _about.scss - [...] With Grunt I would run a task to generate a file called main.scss containing all the @import ,

最全汇总之微前端知识和实战(EMP技术方案)

Deadly 提交于 2020-12-29 10:51:54
我们团队在早早聊的B站直播间分享了 EMP微前端 ---团队半年以来的技术果实。分享的内容全在这里,会讲述微前端的由来,解决的问题,以及EMP微前端方案的不同之处,更有四个实战项目的总结,欢迎大家一起探讨 EMP微前端 的未来。 前言 大家好,今天我们将带来 EMP微前端解决方案 。看到这个名字,大家脑海里是否会想起这些问题:EMP是个什么?微前端又是什么?微前端有什么用?EMP微前端的价值点在哪里? 带着这些问题,我们来一起学习。 首先,介绍一下我们团队成员。 EMP微前端解决方案 是一个生态,是由我们团队成员一起开发和维护以及迭代的。而今天将由我们三个讲师,来讲述 EMP微前端解决方案 的一些原理性知识和具体的实战情况。 听完这次分享,大家可以学到什么呢? 可以学到 EMP微前端解决方案 的脚手架以及生态的设计,给予你借鉴。 通过这套生态的打造, EMP微前端解决方案 实际应用了多个大型项目,有显著的收益,具体的实战项目可以看以下列表: 接下来,我们将讲述的内容目录如下: 业务背景 我们目前的业务是中台业务,需要开发面向公司内部配置的toB产品,这种管理后台系统。当需要开发越来越多的管理系统,我们会发现,很多系统直接可以有些复用的东西,比如:通用的用户数据、UI架构风格、相似的业务逻辑等。 于是,我们要解决的 问题 就是:如何多个应用项目直接,共享一些资源。 按照以往

How to import the electron ipcRenderer in a react / webpack 2 setup

人走茶凉 提交于 2020-12-29 09:40:46
问题 using a electron, react (es6 / jsx), sass, pouchdb and webpack 2 setup. I fail to import or require ipcRenderer to make communication between main and renderer process possible. My setup can be found here: https://github.com/wende60/timeTracker Any hints how to get the ipcRenderer into a react component? Cheers, jo 回答1: I had the same problem. This solved that issue for me: Add in the webpack.config.js : const webpack = require("webpack"); module.exports = { plugins: [ new webpack

Using webpack with a .html entry

不问归期 提交于 2020-12-29 09:34:22
问题 How can I webpack a web app into an output .html file, starting from a traditional input .html ? Here is a simple starting point: index.html <body> <output></output> <script src="./main.js"></script> </body> main.js import React from "react"; document.querySelector("output").innerText = React.version; webpack.config.js module.exports = { entry: "./index.html", output: { filename: "output.html" }, module: { rules: [ {test: /^index\.html$/, use: [ {loader: "extract-loader"}, {loader: "html

Vue-cli 3: “command failed: npm install --loglevel error”

柔情痞子 提交于 2020-12-29 09:09:25
问题 Every time I try to create a new project ( vue create my-project ), I get this error: ERROR : command failed: npm install --loglevel error I'm on PC / Windows 10, Vue-cli 3.2.1, Node 8.11.3, Npm 5.6.0. Presets: Babel, ESLint & Prettier, SASS, Vue router, Vuex From the log: 2736 silly saveTree `-- vuex@3.0.1 2737 warn ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself. 2738 verbose stack Error: EINVAL: invalid argument, read Any

Vue-cli 3: “command failed: npm install --loglevel error”

风流意气都作罢 提交于 2020-12-29 09:02:21
问题 Every time I try to create a new project ( vue create my-project ), I get this error: ERROR : command failed: npm install --loglevel error I'm on PC / Windows 10, Vue-cli 3.2.1, Node 8.11.3, Npm 5.6.0. Presets: Babel, ESLint & Prettier, SASS, Vue router, Vuex From the log: 2736 silly saveTree `-- vuex@3.0.1 2737 warn ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself. 2738 verbose stack Error: EINVAL: invalid argument, read Any

四. web框架-----------VUE vue-cli 脚手架项目搭建(四)

萝らか妹 提交于 2020-12-29 07:54:59
一 .VUE使用 https://cn.vuejs.org/v2/guide/routing.html 1.VUE-CLI 脚手架 vue脚手架指的是vue- cli,它是一个专门为单页面应用快速搭建繁杂的脚手架,它可以轻松的创建新的应用程序而且可用于自动生成vue和webpack的项目模板。 vue -cli是有Vue提供的一个官方cli,专门为单页面应用快速搭建繁杂的脚手架。它是用于自动生成vue.js+webpack的项目模板,是为现代前端工作流提供了 batteries-included C:\Users\86173> npm install vue-cli - g 脚手架安装 npm WARN deprecated vue -cli@2.9.6: This package has been deprecated in favour of @vue/cli npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) C:\Users\ 86173\AppData\Roaming\npm\vue-list -> C:\Users\86173\AppData\Roaming\npm\node_modules\vue-cli\bin

vue的理解

非 Y 不嫁゛ 提交于 2020-12-29 07:53:00
vue提供的MVVM框架模式的数据双向绑定,实现了HTML和js的代码分离,提高代码的维护性 vue.js的核心思想包括:数据驱动和组件化思想。 如果没有中间的ViewModel则关系图编程下面所示:通过Ajax通信获得后台数据,那么要将获得数据显示在DOM上,则需要手动操作DOM节点。这是一个繁琐的过程,还很容易出错。 而使用vue.js后则省去手动操作DOM 。在vue.js里面只需要改变数据,Vue.js通过Directives指令去对DOM做封装,当数据发生变化,会通知指令去修改对应的DOM,数据驱动DOM的变化,DOM是数据的一种功能自然的映射。vue.js还会对操作做一些监听(DOM Listener),当我们修改视图的时候,vue.js监听到这些变化,从而改变数据。这样就形成了数据的双向绑定。 实现数据双向绑定的方法: 数据劫持结合发布者-订阅者模式(vue.js)【vue data是如何实现的??】 vue.js采用数据劫持结合发布者-订阅者的方式,通过Object.defineProperty()来劫持各个属性的setter,getter,在数据变动时,发布消息给订阅者,触发相应的监听回调。 具体的来讲,Vue.js通过Directives指令去对DOM做封装,当数据发生变化,会通知指令去修改对应的DOM,数据驱动DOM的变化。vue.js还会对操作做一些监听

VueJs + Webpack lazyload modules from ElementUI

隐身守侯 提交于 2020-12-29 06:42:20
问题 I would like to lazy-load a specific element of ElementUI in a Vue component. I tried this: import { Tree } from /* webpackChunkName : "element-ui" */ 'element-ui'; Vue.component(Tree.name, Tree); Vue.use(Tree); And this: { components: { 'el-tree': () => import(/* webpackChunkName : "element-ui" */ "element-ui").then(({Tree}) => Tree) } } But in both cases, the element-ui.js chunk file is not created, and the full library is inserted into the main.js file instead. How do I dynamically import