我正在尝试使用angular2 2/ webpack 2堆栈来设置dev环境,我有下一个webpack配置:
// Helper: root() is defined at the bottom
var path = require("path");
var webpack = require("webpack");
// Webpack Plugins
var autoprefixer = require("autoprefixer");
var CommonsChunkPlugin = webpack.optimize.CommonsChu
在使用karma+webpack+typescript时,我无法获得源代码映射来显示正确的行。我尝试过两种设置:devtool: inline-source-maps和devtool: eval-source-maps,但它们都没有显示正确的行。
测试是正确执行的。
问题:我缺少哪些配置选项?
devtool: inline-source-maps
1) should do xyz
ReferenceError: projects is not defined
at UserContext.<anonymous> (/var/folders/lm/nrqzgwd
我有多个布局,这些布局依赖于一些共享的typescript文件,这就是为什么我想要与使用webpack的多个布局共享这个文件的原因。
我正在尝试在我的ajax.ts中包含jquery,并得到以下错误:
ERROR in ../_shared/ajax.ts
Module not found: Error: Can't resolve 'jquery' in '{...}/layouts/_shared'
_shared/ajax.ts:
import * as $ from 'jquery';
export class AjaxL
我正在尝试让一个非常简单的Angular2应用程序工作,与Webpack作为一个模块捆绑。我遵循,并按原样复制了所有配置文件,只是更改了文件路径。然而,当我运行npm-start时,我得到了以下错误,我认为这是一个Webpack错误:
ERROR in ./hello.js
Module parse failed: /home/marieficid/Documentos/cloud/cloud/hello.js Line 1: Unexpected token
You may need an appropriate loader to handle this file type.
| impo
我的webpack.config.js文件如下:
var path = require('path');
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var autoprefixer = require('autoprefixer');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlug
当我尝试运行ng服务时,我得到以下信息
ERROR in ./src/main/webapp/manifest.webapp
Module parse failed: /home/fergal/dev/jhipster/sam/git/sam/src/main/webapp/manifest.webapp Unexpected token (2:8)
You may need an appropriate loader to handle this file type.
| {
| "name": "Sam",
| "short_name"
我很难在Webpack的项目中插上打字稿林特。
显然,是不受欢迎的,他们给作为替代方案。此外,我使用的是,而不是 (不推荐的)--问题是,我在.eslintrc.js中设置的规则似乎没有得到考虑。我在.eslintrc中添加了一个简单的规则,在使用分号时应该会抛出一个错误。
export default class A {
static yes = 'this is static'; // ";" <- should be invalidated by eslint
}
我的依赖关系是:
"@typescript-eslint/eslint-p
我有用类型记录编写的项目,我希望能够调试它(无论是用Chrome Dev Tools还是用Intellij)。
一开始,我发现不支持类型记录的import功能。因此,我尝试使用Webpack和webpack dev server,但这完全失败了。即使我的应用程序工作正常(因为有一个包含所有代码的单个bundle.js文件),它也无法将代码与给定的源代码映射相匹配,这使得调试变得不可能。
在我停止使用webpack之后,我尝试添加require.js作为一个依赖项来解决我得到的require is not defined错误。这很管用,但现在我又被困住了,得到了这个:
未定义的Referenc
注:,我搜索了很多,但是我找不到答案。
我试图通过扩展leaflet来创建一个地图库。但我认为我的问题是在一般情况下使用js库。我使用webpack和ts-loader创建输出文件。
我已经安装了@types/geojson和@types/leaflet类型,并将它们移到模块文件夹中。
下面是我的简单Test1.ts文件:
import * as L from './modules/@types/leaflet/index';
import { MyDataItem } from './MyDataItem ';
export class Test1 {
我得到一个类似于:的错误
...or
我正在使用最新的npm package.json设置:
我没有找到任何解决这个问题的办法。我正在使用ASP.NET本地IIS服务器。项目在2015上启动。
webpack.common.js
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var p
在一个使用类型记录和Webpack的项目中,我希望强制执行通常全局库(例如jQuery)被视为UMD全局函数。
现在,如果在引用import * as $ from 'jQuery'的文件中省略$,webpack会成功,但脚本在运行时失败。然而,import * as _ from 'lodash'有预期的行为失败webpack的建设时,省略。
考虑以下文件:
first.ts
import * as $ from "jquery";
import * as _ from "lodash";
import { second }