Permalink
Browse files

Add build script

  • Loading branch information...
1 parent b52f67a commit 5e558ceae27f8dc0a76ff1990c760136709a107c Alan Hong committed Jan 28, 2016
Showing with 21 additions and 8 deletions.
  1. +1 −0 .gitignore
  2. +20 −7 gulpfile.js
  3. +0 −1 src/main.js
View
@@ -1,2 +1,3 @@
node_modules
*.swp
+public
View
@@ -9,13 +9,12 @@ var config = {
entry: './src/main',
output: {
path: path.join(__dirname, 'public'),
- filename: '[name].js',
- chunkFilename: '[chunkhash].js'
+ filename: '[name].js'
},
module: {
loaders: [
- { test: /\.css$/, loader: 'style-loader!css-loader' },
- { test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=100000' }
+ { test: /\.css$/, loader: 'style-loader!css-loader' },
+ { test: /\.(png|woff|woff2|eot|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=100000' }
]
},
plugins: [
@@ -32,10 +31,11 @@ var config = {
]
};
-gulp.task('server', function(callback) {
- var compiler = webpack(config);
+var serverConfig = Object.assign(config, {
+});
- var server = new WebpackDevServer(compiler, {
+gulp.task('server', function(callback) {
+ var server = new WebpackDevServer(webpack(serverConfig), {
stats: {
colors: true
}
@@ -49,3 +49,16 @@ gulp.task('server', function(callback) {
gutil.log('[webpack-dev-server]', 'http://localhost:8080');
});
});
+
+gulp.task('build', function(callback) {
+ webpack(config, function(err, stats) {
+ if (err) {
+ throw new gutil.PluginError('webpack-dev-server', err);
+ }
+
+ gutil.log('[webpack]', stats.toString());
+ callback();
+ });
+});
+
+gulp.task('default', ['build']);
View
@@ -3,7 +3,6 @@ require('bootstrap/js/dropdown.js');
require('bootstrap/js/tooltip.js');
require('bootstrap/dist/css/bootstrap.css');
require('font-awesome/css/font-awesome.css');
-require('codemirror/lib/codemirror.css');
require('summernote/dist/summernote.css');
require('summernote');

0 comments on commit 5e558ce

Please sign in to comment.