Browse Source

created npm build task

beta
Frankie Bagnardi 11 years ago
parent
commit
98ed45ced5
  1. 1
      .gitignore
  2. 50
      Gruntfile.js
  3. 15
      package.json

1
.gitignore

@ -4,6 +4,7 @@ node/server.json
test/coverage/
coverage/
semantic.config
semanticui/
# Numerous always-ignore extensions
*.diff

50
Gruntfile.js

@ -82,6 +82,12 @@ module.exports = function(grunt) {
// creates custom license in header
'cssmin:createMinCSSPackage',
// create npm package
'copy:npm',
// replace $.fn.xyz with module.exports and require('jquery')
'replace:npm',
// cleans previous generated release
'clean:release'
@ -427,6 +433,24 @@ module.exports = function(grunt) {
]
},
npm: {
files: [
{
expand : true,
cwd : 'build/uncompressed',
src : [
'**/*'
],
dest: 'semanticui'
},
{
src: 'package.json',
dest: 'semanticui/package.json'
}
]
},
// create new rtl assets
buildToRTL: {
files: [
@ -564,6 +588,31 @@ module.exports = function(grunt) {
}
},
replace: {
npm: {
options: {
patterns: [
{
match: /\$.fn.\w+/g,
replacement: 'module.exports'
},
{
match: /jQuery/g,
replacement: 'require("jquery")'
}
]
},
files: [
{
expand : true,
src : '**/*.js',
cwd : 'build/uncompressed',
dest : 'semanticui'
}
]
}
},
uglify: {
minifyJS: {
@ -630,6 +679,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');

15
package.json

@ -1,5 +1,5 @@
{
"name": "semantic",
"name": "semanticui",
"version": "0.15.1",
"title": "Semantic UI",
"description": "Semantic empowers designers and developers by creating a shared vocabulary for UI.",
@ -13,13 +13,15 @@
"type": "git",
"url": "git://github.com/Semantic-Org/Semantic-UI.git"
},
"dependencies": {},
"dependencies": {
"jquery": "*"
},
"devDependencies": {
"docpad": "~6.63.3",
"docpad-plugin-eco": "~2.0.3",
"docpad-plugin-ghpages": "~2.4.1",
"docpad-plugin-ghpages": "~2.4.2",
"docpad-plugin-partials": "~2.8.1",
"grunt": "~0.4.1",
"grunt": "~0.4.4",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-uglify": "~0.2.2",
@ -40,9 +42,6 @@
"grunt-autoprefixer": "~0.4.0",
"grunt-karma-coveralls": "~2.2.0",
"karma-coverage": "~0.1.4",
"docpad-plugin-partials": "~2.8.1",
"docpad-plugin-ghpages": "~2.4.2",
"docpad-plugin-eco": "~2.0.3",
"docpad": "~6.63.3"
"grunt-replace": "~0.7.3"
}
}

Loading…
Cancel
Save