webpack-2

Navigation Error in angular2

倖福魔咒の 提交于 2019-12-29 11:48:09
问题 I have updated the angular packages version from 2.4.10 to 4.0.0 after updating i am getting the following errors while navigating. ERROR Error: Uncaught (in promise): Error: Found the synthetic property @transformPlaceholder. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application. Error: Found the synthetic property @transformPlaceholder. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application And i changed the

webpack2: how to import Bootstrap CSS for react-bootstrap to find its styles?

孤街浪徒 提交于 2019-12-29 06:25:11
问题 I am using webpack 2 and react-bootstrap in my project ; I can't find how to have bootstrap CSS styles properly applied it seems like the .css file is not loaded, no matter which import statement I tried to use. As far as I understand I do not need the full bootstrap package with javascript etc. since I am using react-bootstrap ; I just need the CSS. So I added this in my main.js file: import 'bootstrap/dist/css/bootstrap.css'; It seems to work (no error message) but the styles are not

Webpack import multiple less files using glob expressions?

扶醉桌前 提交于 2019-12-25 09:03:48
问题 I have been trying to import less files automatically using webpack's less-loader, but glob expressions don't work in root.less file. In detail, I am replacing gulp builder with webpack and I can use this pattern: @import 'widgets/**/*.less'; to import less files in gulp automatically (Please check this link glob expressions). However, this pattern is not valid in webpack and less-loader seems that do not support as well. I tried to use require.context the method of webpack, but I cannot

Webpack Chunks In Separate Folder

怎甘沉沦 提交于 2019-12-24 10:59:30
问题 I want to implement code-splitting feature in my app. I split my app by routes and for every route I user require.ensure to import component. I try to put all chunks in chunk folder, so I change output in config file: output: { filename: "chunks/bundle[name].js" } But I got 404 error. Error: Loading chunk 2 failed at HTMLScriptElement.onScriptComplete So I leave it in folder where I have bundle file: var webpack = require("webpack"); module.exports = { entry: "./js/app.js", output: { filename

sass-loader generates broken source maps

懵懂的女人 提交于 2019-12-24 07:58:33
问题 In my project I'm including one CSS file and one SCSS file: require('./../vendor/glyphicons/glyphicons.css'); require('./../css/main.scss'); Source map for CSS - works fine : { test: /\.css$/, loader: ExtractTextPlugin.extract({ loader: ['css-loader?sourceMap'] }) } Source map for SCSS - broken (all rules point to same line, to parent element - body ) { test: /\.scss$/, loader: ExtractTextPlugin.extract({ loader: ['css-loader?sourceMap', 'postcss-loader', 'sass-loader?sourceMap'] }) } EDIT :

How to use webpack DLL Plugin?

本小妞迷上赌 提交于 2019-12-24 07:20:09
问题 I am just starting to use webpack 3 and dllplugin. I managed to find a few blog articles abt. this. However none of them with a proper code sample/ GitHub samplecode. Does anyone know any references to sample code for this/ working example? 回答1: This is a good simple example: We define our functions in vendor.js (this is the library that we are going to reference as DLL). vendor.js function square(n) { return n*n; } module.exports = square; Then define WebPack configuration to export this as

Webpack 2 - Suppress chunk files

可紊 提交于 2019-12-24 06:04:44
问题 As we are putting this output on a load balancer (not using sticky), we need to place the output of these files without chunks (neither hashes). These are the main two files for webpack configuration. webpack.common.js const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const helpers = require('./helpers'); const STATIC_TRANSLATION_MAP = require('..

How to require/import .less file in typescript file

梦想与她 提交于 2019-12-23 15:50:49
问题 I am trying to import a .less file in .ts file but I am not able to do that. I am using webpack2 as bundler & webstorm IDE Here snippet for less loader in a webpack.config.js file { test: /\.less$/, //less loader loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', //loader: 'css-loader!less-loader' loader: 'raw-loader!less-loader' }) }, { test: /\.ts$/, //typescript loader //include: path.resolve(__dirname, "ts-src"), include: path.resolve(__dirname, "js"), loader: "ts-loader"

How to disable require-jsdoc eslint in webpack

蓝咒 提交于 2019-12-23 15:34:53
问题 Error : [eslint] Missing JSDoc comment. (require-jsdoc) I want to disable this error from webpack config so that it will not be displayed on the console. 回答1: I used the .eslintrc.json file and added this under rules "require-jsdoc" : 0 I don't use webpack. Hope this helps. 来源: https://stackoverflow.com/questions/49237035/how-to-disable-require-jsdoc-eslint-in-webpack

Using less-plugin-glob with Webpack

陌路散爱 提交于 2019-12-23 11:48:23
问题 I am trying to migrate the build system for an existing project from gulp to webpack . It currently has a single entry point .less file which imports various other files as follows: @import 'bower_components/bootstrap/less/bootstrap.less'; @import 'components/**/*.less'; This writes out a single css file which includes all of the .less files found. It uses https://github.com/just-boris/less-plugin-glob to allow globs. Over in Webpack I have got as far as trying to use a combination of less