mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Improved webpack config
This commit is contained in:
parent
e88893335a
commit
3a4355416c
4521
build/dat.gui.js
Normal file
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
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
43
webpack/webpack.config.js
Normal 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
15
webpack/webpack.config.min.js
vendored
Normal 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);
|
Loading…
Reference in New Issue
Block a user