1 Star 1 Fork 246

albert / xuanxuan

forked from easysoft / xuanxuan 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.base.js 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
Catouse 提交于 2017-02-06 09:24 . * add alias setting to webpack config.
/**
* Base webpack config used across other specific configs
*/
import path from 'path';
import validate from 'webpack-validator';
import {
dependencies as externals
} from './app/package.json';
export default validate({
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['babel-loader'],
exclude: /node_modules/
}, {
test: /\.json$/,
loader: 'json-loader'
}],
noParse: [/pouchdb/, /granim/]
},
output: {
path: path.join(__dirname, 'app'),
filename: 'bundle.js',
// https://github.com/webpack/webpack/issues/1114
libraryTarget: 'commonjs2'
},
// https://webpack.github.io/docs/configuration.html#resolve
resolve: {
extensions: ['', '.js', '.jsx', '.json'],
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main'],
alias: {
Theme: 'theme.js',
App: 'app.js',
Resource: 'resource.js',
Lang: 'lang.js',
Events: 'event-center.js',
Helper: 'utils/helper.js',
Components: 'views/components',
Views: 'views',
Utils: 'utils',
Models: 'models'
},
root: path.join(__dirname, 'app')
},
plugins: [],
externals: Object.keys(externals || {})
});
NodeJS
1
https://gitee.com/ysguoqiang/xuanxuan.git
git@gitee.com:ysguoqiang/xuanxuan.git
ysguoqiang
xuanxuan
xuanxuan
master

搜索帮助