Improved webpack config

This commit is contained in:
Tomas Korcak 2015-08-14 18:30:03 +02:00
parent e88893335a
commit 3a4355416c
4 changed files with 4580 additions and 0 deletions

4521
build/dat.gui.js Normal file

File diff suppressed because one or more lines are too long

1
build/dat.gui.js.map Normal file

File diff suppressed because one or more lines are too long

43
webpack/webpack.config.js Normal file
View File

@ -0,0 +1,43 @@
var path = require("path");
module.exports = {
target: 'web',
context: path.resolve(__dirname, '..', 'src'),
entry: {
main: '../index'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
},
{
test: /\.css$/,
loader: "style-loader!css-loader"
},
{
test: /\.png$/,
loader: "url-loader?limit=100000"
},
{
test: /\.jpg$/, loader: "file-loader"
},
{
test: /\.scss$/,
loader: 'style!css!sass'
}
]
},
output: {
path: path.join(__dirname, '..', 'build'),
filename: 'dat.gui.js',
library: ['dat'],
libraryTarget: 'umd'
}
};

15
webpack/webpack.config.min.js vendored Normal file
View File

@ -0,0 +1,15 @@
var extend = require('extend'),
webpack = require('webpack'),
webpackConfig = require('./webpack.config');
var config = {
plugins: [
new webpack.optimize.UglifyJsPlugin({minimize: true})
],
output: {
filename: 'dat.gui.min.js'
}
}
module.exports = extend(true, webpackConfig, config);