webpack-4

Dynamic Module Import with its own chunk dependencies

安稳与你 提交于 2020-01-29 21:34:00
问题 I am trying to use Module Dynamic Import to create a bundle with an npm package using this is an excellent tutorial: https://webpack.js.org/guides/code-splitting/ But the npm package that I want to load dynamically has its own chunk dependencies: npm package chunk dependencies I can see that Webpack created correctly the vendor chunk: files generated But the npm package to import 's chunks are not re-imported, so it fails: the error I googled a lot but I couldn't find much information about

Dynamic Module Import with its own chunk dependencies

故事扮演 提交于 2020-01-29 21:32:43
问题 I am trying to use Module Dynamic Import to create a bundle with an npm package using this is an excellent tutorial: https://webpack.js.org/guides/code-splitting/ But the npm package that I want to load dynamically has its own chunk dependencies: npm package chunk dependencies I can see that Webpack created correctly the vendor chunk: files generated But the npm package to import 's chunks are not re-imported, so it fails: the error I googled a lot but I couldn't find much information about

Addng css files in React project with Webpack 4

让人想犯罪 __ 提交于 2020-01-25 08:39:08
问题 I am building a simple React app from scratch using Webpack. I was finally able to run the dev server and when I tried to apply some styles via CSS, the files wouldn't load and I assume my Webpack 4 configuration is not right. Here is the code: webpack.config.js // const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const path = require('path'); module.exports = { mode: 'development', entry: ['./src/index.js'], resolve: { extensions: [".js", ".jsx"] }, output: { filename: 'main

Unknown “encore_entry_link_tags” function when using Webpack Encore ^0.21.0

狂风中的少年 提交于 2020-01-21 06:39:39
问题 I would like to use the new version of Webpack encore to have access to all the new features it offers. however after following the steps in the official guide I can't make it to work and I get Unknown "encore_entry_link_tags" function What I did: Update my php version to match requierement of Webpack encore bundle (>7.1.9) run composer require symfony/webpack-encore-bundle update the version of encore on the package.json 0.21.0 run npm install --save-dev clear cache I'm not sure why this is

Handle missing dynamic chunks after new deployment with Webpack

孤者浪人 提交于 2020-01-14 18:54:44
问题 I have an AngularJs (1.7) SPA with Webpack (4.x). This is how we create chunknames: config.output = { path: PATHS.build, publicPath: '/dist/', filename: `[name]${isDev ? '' : '.[contenthash:8]'}.bundle.js`, chunkFilename: `chunks/[name]${isDev ? '' : '.[contenthash:8]'}.chunk.js` }; The lazyloading is done in the state definitions in ui-router basically like this: $stateProvider .state('reports', { url: '/projects/:project_id/reports', lazyLoad: function($transition$) { const injector =

loading css url() files in a specific folder with webpack

痴心易碎 提交于 2020-01-14 09:05:30
问题 I'm using a node library that has a css file inside, that css file loads an image like this background-image: url("image.png"); The file "image.png" is being requested at http://localhost:9000/ (the root) is dirty to have images all over the root of the project. Also I have another problem, I don't know why the image file of the module is not being copied to the build folder automatically, only works if I copy the image file manually to the build folder. Playing with Webpack config parameters

How to remove unused CSS using webpack 4?

折月煮酒 提交于 2020-01-13 10:07:25
问题 I am having problem removing unused CSS in webpack 4. It seems that most of the CSS purification plugins are dependent on extract text plugin which is not updated for version 4. Here's my commands: node_modules/.bin/webpack --mode=development --env.operation=separateCSS OR node_modules/.bin/webpack --mode=development --env.operation=bundleCSS Here's part of my webpack.config.js: rules: [ // Loader for SASS files { test: /\.s[ac]ss$/, use: [ // Use IIFE to choose how to emit the CSS: 1.

How to remove unused CSS using webpack 4?

冷暖自知 提交于 2020-01-13 10:07:19
问题 I am having problem removing unused CSS in webpack 4. It seems that most of the CSS purification plugins are dependent on extract text plugin which is not updated for version 4. Here's my commands: node_modules/.bin/webpack --mode=development --env.operation=separateCSS OR node_modules/.bin/webpack --mode=development --env.operation=bundleCSS Here's part of my webpack.config.js: rules: [ // Loader for SASS files { test: /\.s[ac]ss$/, use: [ // Use IIFE to choose how to emit the CSS: 1.

Do I ever need explicit allowSyntheticDefaultImports if esModuleInterop is true configuring TypeScript transpilation?

自作多情 提交于 2020-01-10 22:05:27
问题 I need confirmation on the following theory. According to TS docs, there are two options that can be set in tsconfig.json . --allowSyntheticDefaultImports: Allow default imports from modules with no default export. This does not affect code emit, just typechecking. --esModuleInterop: Emit __importStar and __importDefault helpers for runtime babel ecosystem compatibility and enable --allowSyntheticDefaultImports for typesystem compatibility. When I google around, I see both being set to true

Do I ever need explicit allowSyntheticDefaultImports if esModuleInterop is true configuring TypeScript transpilation?

送分小仙女□ 提交于 2020-01-10 22:03:05
问题 I need confirmation on the following theory. According to TS docs, there are two options that can be set in tsconfig.json . --allowSyntheticDefaultImports: Allow default imports from modules with no default export. This does not affect code emit, just typechecking. --esModuleInterop: Emit __importStar and __importDefault helpers for runtime babel ecosystem compatibility and enable --allowSyntheticDefaultImports for typesystem compatibility. When I google around, I see both being set to true