webpack-4

getting error when trying to upgrade to vuetify 2.0

自闭症网瘾萝莉.ら 提交于 2020-01-06 06:18:06
问题 Ok so I am trying for the second time to migrate thus far it has been a complete failure it seems that vuetify is not detected, unfortunately I cannot share my full repo since it is work related, but will describe steps and share relevant code. Project was created with vue-cli 3.3.0 with a vue.config.js file for environment variables. 1) npm uninstall vuetify 2)vue add vuetify 3)npm run serve my site does not load and I get this error (adding code): //vue.config.js module.exports = {

Vue SFC styles not being extracted in webpack production build

蓝咒 提交于 2020-01-06 05:35:30
问题 Trying to add vue (and SFCs) to my webpack app. The <template> and <script> blocks work fine, but for some reason the styles in the <style> block are not being extracted for production build. In the dev build, it's extracting the .vue <style> block to a separate css file (named for the entrypoint). Which is OK but I'd prefer they went into my main stylesheet. But no matter what I try, I can't get any .vue styles to show up (in any file) for the production build. This is an abbreviated version

How to code split one of two entries in Webpack 4?

谁说胖子不能爱 提交于 2020-01-03 20:34:15
问题 I’ve got a seemingly pretty straightforward Webpack code splitting setup that I’m having trouble migrating to Webpack 4. I have two entries, called main and preview . I want to do an initial code split into a vendor chunk for the vendor modules in main , but I want to keep preview as a single chunk. Relevant part of the working configuration in Webpack 3: { entry: { main: './src/application.js', preview: './src/preview.js', }, plugins: [{ new webpack.optimize.CommonsChunkPlugin({ name:

When i using file-loader and html-loader in webpack. The src attr of image gonna be like '[object Module]'

一笑奈何 提交于 2020-01-03 16:52:30
问题 I am doing a project with webpack4 from scratch. But when i try to display an image in html file. I faced a wired problem: After npm run build . the src of image tag gonna be built as <image src="[object Module]" . The html part is: <img src="images/main_background.jpg"> The webpack.config.js is like this : // ignore ... { test: /\.html$/, use: [ {loader: 'html-loader'} ] }, { test: /\.(jpeg|jpg|png)$/, use: [ 'file-loader' ] } And the version of these two loaders: "file-loader": "^5.0.2",

Webpack 4 + Babel leaving const in transpiled code

若如初见. 提交于 2020-01-03 16:42:58
问题 I'm trying to get my code working on Android 4.1 Webview, which doesn't support ES6. But I am getting this error: Uncaught SyntaxError: Use of const in strict mode. .babelrc config { "plugins": [ "lodash" ], "presets": [ "@babel/preset-react", [ "@babel/preset-env", { "targets": { "android": "4.1" }, "useBuiltIns": "usage", "forceAllTransforms": true } ], "@babel/preset-stage-0" ] } webpack.config.js rules: [ { enforce: 'pre', test: /\.jsx?$/, exclude: /node_modules/, loader: "eslint-loader"

_lazy_route_resource lazy namespace object

北战南征 提交于 2020-01-02 01:31:07
问题 I'm using angular compiler: const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; With these compiler options: "angularCompilerOptions": { "genDir": "./build/compiled", "outDir": "./build/compiled", "skipMetadataEmit": true, "debug": true}, Relevant part of my package.json is: "@ngtools/webpack": "^6.0.0", "@angular/router": "^5.2.0", "webpack": "4.8.3", "webpack-cli": "2.1.4", And my angularCompilerPlugin config is: new AngularCompilerPlugin({ tsConfigPath: 'path

Refused to execute script from because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled

ⅰ亾dé卋堺 提交于 2020-01-01 08:41:55
问题 I am trying to setup react routing which works when I click on something on my site the route works, however if I open a new tab and copy that url. I get Refused to execute script from 'http://localhost:8080/something/index_bundle.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. webpack.config const path = require("path"); const HtmlWebpackPlugin = require("html-webpack-plugin"); module.exports = { entry: "./src/index.js", output: { path:

Load video mp4 webpack loader

爱⌒轻易说出口 提交于 2019-12-31 03:26:08
问题 How to use loader for mp4 video format with webpcak 4, I try like this: { test: /\.mp4$/, use: 'file-loader', loader: 'file-loader?name=videos/[name].[ext]', }, and import like this import pressButtonAnimated from './images/pressButtonAnimated.mp4' But it does not work for me, and I get an error You may need an appropriate loader to handle this file type. But this one is work for me, but I don wanna add in each file import pressButtonAnimated from '-!file-loader!./images/pressButtonAnimated

Transpiling and linting files outside of my root directory webpack 4

此生再无相见时 提交于 2019-12-25 00:24:00
问题 I'm developing a module that processes files from outside its root directory, so, for example, if I have the following folder structure: Frontend -> src -> chunks -> js -> main.es6 Frontend -> src -> chunks -> scss -> styles.scss Frontend -> node_modules -> @workspace -> module -> client -> index.js I try to process the files inside Frontend/src (es6 and scss) from inside the module located in the node_modules folder with webpack 4 but babel-loader is not transpiling and sass-loader is not

Webpack 4: Target: NodeJS. Mode: production; MySQL Error: Received packet in the wrong sequence

喜夏-厌秋 提交于 2019-12-24 00:56:33
问题 Just upgraded to Webpack 4 and when building my server side code with mode:'production' .I get this MySQL Error: Received packet in the wrong sequence. How can you prevent such mangling from happening? 回答1: I have faced the same problem when bundling with web pack. at last i have solved the issue. i think it is an issue related to web-pack and babel-loader version mismatch. i suggest following combinations in package.json "babel-core": "^6.26.0", "babel-loader": "^7.1.2", "babel-plugin