mirror of
https://github.com/til-schneider/slim-wiki.git
synced 2025-08-05 08:07:35 +02:00
Added grunt task for creating a release zip
This commit is contained in:
38
README.md
38
README.md
@@ -16,28 +16,48 @@ Check out the **[demo website](http://slim-wiki.murfman.de/)** for more details
|
|||||||
Want to develop slim wiki?
|
Want to develop slim wiki?
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
### Set up build environment
|
||||||
|
|
||||||
|
1. Install [node.js](https://nodejs.org/en/) (this includes `npm`)
|
||||||
|
|
||||||
|
2. Install grunt globally:
|
||||||
|
|
||||||
|
sudo npm install -g grunt-cli
|
||||||
|
|
||||||
|
3. Install grunt dependencies in project:
|
||||||
|
|
||||||
|
cd src
|
||||||
|
npm install
|
||||||
|
|
||||||
|
|
||||||
### Build instructions
|
### Build instructions
|
||||||
|
|
||||||
Install grunt globally:
|
|
||||||
|
|
||||||
sudo npm install -g grunt-cli
|
|
||||||
|
|
||||||
Install grunt dependencies in project:
|
|
||||||
|
|
||||||
cd src
|
|
||||||
npm install
|
|
||||||
|
|
||||||
Build client:
|
Build client:
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
grunt
|
grunt
|
||||||
|
|
||||||
|
Now link the project directory to a locally installed Apache Webserver with PHP and `mod_rewrite` enabled.
|
||||||
|
|
||||||
|
Go to the browser and open one of:
|
||||||
|
|
||||||
|
- `http:localhost/path/to/src/` - for the development version using the source JavaScript files.
|
||||||
|
- `http:localhost/path/to/dist/` - for the production version using compressed CSS and JavaScript.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Other build options
|
||||||
|
|
||||||
Build automatically on source changes (watch mode):
|
Build automatically on source changes (watch mode):
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
grunt watch
|
grunt watch
|
||||||
|
|
||||||
|
Build a release zip:
|
||||||
|
|
||||||
|
cd src
|
||||||
|
grunt release
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Installation instructions
|
### Installation instructions
|
||||||
|
@@ -3,7 +3,8 @@ module.exports = function (grunt) {
|
|||||||
|
|
||||||
require('load-grunt-tasks')(grunt);
|
require('load-grunt-tasks')(grunt);
|
||||||
|
|
||||||
var dist = __dirname + '/../dist';
|
var projectDir = __dirname + '/..';
|
||||||
|
var dist = projectDir + '/dist';
|
||||||
|
|
||||||
grunt.registerTask('build', [
|
grunt.registerTask('build', [
|
||||||
'copy',
|
'copy',
|
||||||
@@ -20,6 +21,12 @@ module.exports = function (grunt) {
|
|||||||
'build'
|
'build'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
grunt.registerTask('release', [
|
||||||
|
'clean',
|
||||||
|
'build',
|
||||||
|
'compress:releaseZip'
|
||||||
|
]);
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
|
||||||
clean: {
|
clean: {
|
||||||
@@ -64,6 +71,28 @@ module.exports = function (grunt) {
|
|||||||
html: dist + '/server/layout/page.php'
|
html: dist + '/server/layout/page.php'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
compress: {
|
||||||
|
releaseZip: {
|
||||||
|
options: {
|
||||||
|
archive: dist + '/slim-wiki.zip'
|
||||||
|
},
|
||||||
|
files: [
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: projectDir,
|
||||||
|
src: [ 'LICENSE', 'README.md' ],
|
||||||
|
dest: 'slim-wiki/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: dist,
|
||||||
|
src: [ '.htaccess', 'config-example.php', 'index.php', 'articles/**', 'client/**', 'data/dummy.txt', 'server/**' ],
|
||||||
|
dest: 'slim-wiki/'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
less: {
|
less: {
|
||||||
files: 'client/less/*.less',
|
files: 'client/less/*.less',
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
"grunt": "0.4.x",
|
"grunt": "0.4.x",
|
||||||
"grunt-contrib-clean": "0.6.x",
|
"grunt-contrib-clean": "0.6.x",
|
||||||
"grunt-contrib-concat": "0.5.x",
|
"grunt-contrib-concat": "0.5.x",
|
||||||
|
"grunt-contrib-compress": "0.13.x",
|
||||||
"grunt-contrib-copy": "0.8.x",
|
"grunt-contrib-copy": "0.8.x",
|
||||||
"grunt-contrib-cssmin": "0.12.x",
|
"grunt-contrib-cssmin": "0.12.x",
|
||||||
"grunt-contrib-less": "1.0.x",
|
"grunt-contrib-less": "1.0.x",
|
||||||
|
Reference in New Issue
Block a user