我正在使用webpack和gulp,这是我的webpack配置:
webpack.config.js
IGrouping<DateTime, Option> optvalues;
foreach (var symbol in optvalues.SelectMany(t => t).Select(t => t.Root).Distinct())
{
//
}
scripts.js (这就是此文件中的所有内容)
const path = require('path');
var HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
module.exports = {
output: {
publicPath: "./dist/",
path: path.join(__dirname, "/js/"),
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ["env"]
}
},
{
test: /\.vue$/,
loader: 'vue-loader'
}
]
},
resolve: {
alias: {
moment: 'moment/src/moment'
}
},
externals: {
jquery: 'jQuery',
$: 'jQuery',
moment: 'moment',
"velocity-animate": 'velocity'
},
plugins: [
new HardSourceWebpackPlugin()
]
};
我收到此错误
import velocity from 'velocity-animate';
此行出错:
Uncaught ReferenceError: velocity is not defined
我是否在使用外部配置做错了什么? 这适用于moment.js和jQuery,但不适用于速度......
我试过
module.exports = velocity;
和
"velocity-animate": 'velocity'
和
"velocity-animate": 'velocity-animate'
这些都不起作用。如果第一个不是'velocity-animate'(包的名称),那么无论如何Velocity.js都包含在脚本中。关于这个的文档并没有真正解释如何正确配置这个
这个用例真的可能是如此利基,以至于世界上没有人可以解释它吗?
谢谢!