mirror of
https://github.com/react-webpack-generators/generator-react-webpack.git
synced 2025-12-08 18:01:59 +00:00
commit 25ef9a176ee9bab902579f79415bd6047a77a62f
Author: Simon Bailey <simon@newtriks.com>
Date: Thu May 15 19:51:45 2014 +0100
Updated README
Signed-off-by: Simon Bailey <simon@newtriks.com>
commit 1b0020c8fd248bc0dc892bed1f3e315867378274
Merge: d8fd494 c468b98
Author: Edd <accounts@edd.fm>
Date: Sat Apr 26 11:13:52 2014 +0100
Merged with Master
commit d8fd494478cb7fd0d97a47a90986f4c1b29eb996
Author: Edd <accounts@edd.fm>
Date: Thu Apr 24 22:09:19 2014 +0100
Trimming redundant options from Gruntfile
commit b5015ae42b0beb770ae1b146f152b5f38764987e
Author: Edd <accounts@edd.fm>
Date: Sun Mar 30 21:32:14 2014 +0100
Moved development mode to webpack-dev-server to imrove rebuild times
commit 7d31ade8085a8d415b95c67dba69ae5157ebf9b4
Author: Edd <accounts@edd.fm>
Date: Wed Feb 26 00:18:56 2014 +0000
Changed JSX filenames to .jsx over .js
commit 00faa6182b6cb4ae46b05dd12db1e73da4b47953
Author: Edd <accounts@edd.fm>
Date: Mon Feb 24 23:39:18 2014 +0000
Updated engines & Travis build targets
commit e58e0d70639f3c3e9acc7d085b6a795365a140a6
Author: Edd <accounts@edd.fm>
Date: Mon Feb 24 23:26:04 2014 +0000
Added auto generation of a template CSS file for a component
commit f6c67351aead570224b2457261d457a1954277dc
Author: Edd <accounts@edd.fm>
Date: Mon Feb 24 00:06:42 2014 +0000
Updated default app test
commit 996d769685d1a4f20ae2c4117422790bbc347594
Author: Edd <accounts@edd.fm>
Date: Sun Feb 23 23:32:37 2014 +0000
Added test for default main component (currently identical to any other component tests)
commit 31dfcbaff6ee9aef339886897e053a339f98021b
Author: Edd <accounts@edd.fm>
Date: Sun Feb 23 22:54:04 2014 +0000
Moved webpack configuration to a separate file
- Added webpack config file
- Added Uglify to webpack config
- Added source maps in webpack config
Moved entry file back in to Gruntfile
commit 6b3a3e92b80f3121e1128e4f166cf36aa32cfa26
Author: Edd <accounts@edd.fm>
Date: Sun Feb 23 17:23:07 2014 +0000
Added distribution folder & Grunt tasks to deal with it
- Created Distribution build folder (script link broken)
- Added grunt-contrib-copy
- Added grunt-uglify
- Bumped React version number
- Switched source map types
Signed-off-by: Simon Bailey <simon@newtriks.com>
126 lines
2.4 KiB
JavaScript
126 lines
2.4 KiB
JavaScript
'use strict';
|
|
|
|
var mountFolder = function (connect, dir) {
|
|
return connect.static(require('path').resolve(dir));
|
|
};
|
|
|
|
var webpackDistConfig = require('./webpack.dist.config.js'),
|
|
webpackDevConfig = require('./webpack.config.js');
|
|
|
|
module.exports = function (grunt) {
|
|
// Let *load-grunt-tasks* require everything
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
// Read configuration from package.json
|
|
var pkgConfig = grunt.file.readJSON('package.json');
|
|
|
|
grunt.initConfig({
|
|
pkg: pkgConfig,
|
|
|
|
webpack: {
|
|
options: webpackDistConfig,
|
|
|
|
dist: {
|
|
cache: false
|
|
}
|
|
},
|
|
|
|
'webpack-dev-server': {
|
|
options: {
|
|
port: 8000,
|
|
webpack: webpackDevConfig,
|
|
publicPath: '/scripts/',
|
|
contentBase: './<%= pkg.src %>/',
|
|
},
|
|
|
|
start: {
|
|
keepAlive: true,
|
|
}
|
|
},
|
|
|
|
connect: {
|
|
options: {
|
|
port: 8000
|
|
},
|
|
|
|
dist: {
|
|
options: {
|
|
keepalive: true,
|
|
middleware: function (connect) {
|
|
return [
|
|
mountFolder(connect, pkgConfig.dist)
|
|
];
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
open: {
|
|
options: {
|
|
delay: 500
|
|
},
|
|
dev: {
|
|
path: 'http://localhost:<%= connect.options.port %>/webpack-dev-server/'
|
|
},
|
|
dist: {
|
|
path: 'http://localhost:<%= connect.options.port %>/'
|
|
}
|
|
},
|
|
|
|
karma: {
|
|
unit: {
|
|
configFile: 'karma.conf.js'
|
|
}
|
|
},
|
|
|
|
copy: {
|
|
dist: {
|
|
files: [
|
|
// includes files within path
|
|
{
|
|
flatten: true,
|
|
expand: true,
|
|
src: ['<%= pkg.src %>/*'],
|
|
dest: '<%= pkg.dist %>/',
|
|
filter: 'isFile'
|
|
},
|
|
{
|
|
flatten: true,
|
|
expand: true,
|
|
src: ['<%= pkg.src %>/images/*'],
|
|
dest: '<%= pkg.dist %>/images/'
|
|
},
|
|
]
|
|
}
|
|
},
|
|
|
|
clean: {
|
|
dist: {
|
|
files: [{
|
|
dot: true,
|
|
src: [
|
|
'<%= pkg.dist %>'
|
|
]
|
|
}]
|
|
}
|
|
}
|
|
});
|
|
|
|
grunt.registerTask('serve', function (target) {
|
|
if (target === 'dist') {
|
|
return grunt.task.run(['build', 'open:dist', 'connect:dist']);
|
|
}
|
|
|
|
grunt.task.run([
|
|
'open:dev',
|
|
'webpack-dev-server'
|
|
]);
|
|
});
|
|
|
|
grunt.registerTask('test', ['karma']);
|
|
|
|
grunt.registerTask('build', ['clean', 'copy', 'webpack']);
|
|
|
|
grunt.registerTask('default', []);
|
|
};
|