Показать сообщение отдельно
  #18 (permalink)  
Старый 24.07.2015, 01:30
Аватар для nerv_
junior
Отправить личное сообщение для nerv_ Посмотреть профиль Найти все сообщения от nerv_
 
Регистрация: 29.11.2011
Сообщений: 3,924

этот конфиг на примере gulp'а:

package.json
{
    "name": "project_name",
    "version": "0.0.0",
    "private": true,
    "description": "",
    "dependencies": {
        "babel": "^4.7.16",
        "babel-loader": "^4.0.0",
        "json-loader": "^0.5.1",
        "html-loader": "^0.2.3",
        "gulp": "^3.9.0",
        "webpack": "^1.10.1",
        "webpack-stream": "^2.0.0"
    },
    "scripts": {
    }
}


gulpfile.js
// [url]https://github.com/gulpjs/gulp/blob/master/docs/README.md[/url]
var gulp = require('gulp');
// [url]http://webpack.github.io/docs/[/url]
var webpack = require('webpack');
// [url]https://github.com/shama/webpack-stream[/url]
var webpackStream = require('webpack-stream');


gulp.task(
    'xmlmarket/build',
    function() {
        return gulp
            .src('./httpdocs/js/angular/application/modules/xmlmarket/module.js')
            .pipe(webpackStream({
                module: {
                    loaders: [
                        // [url]https://github.com/babel/babel-loader[/url]
                        {test: /\.js$/, loader: 'babel'},
                        // [url]https://github.com/webpack/json-loader[/url]
                        {test: /\.json$/, loader: 'json'},
                        // [url]https://github.com/webpack/html-loader[/url]
                        {test: /\.html$/, loader: 'html'}
                    ]
                },
                plugins: [
                    // [url]http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin[/url]
                    new webpack.optimize.UglifyJsPlugin({
                        compress: {
                            warnings: false
                        }
                    })
                ],
                devtool: 'source-map',
                debug: true,
                output: {
                    filename: 'angular-xmlmarket.min.js'
                }
            }))
            .pipe(gulp.dest('./httpdocs/js/angular/modules/'));
    }
);


gulp.task(
    'xmlmarket/watch', function() {
        return gulp
            .watch(
                [
                    './httpdocs/js/angular/application/modules/xmlmarket/**/*.js',
                    './httpdocs/js/angular/application/modules/xmlmarket/**/*.json',
                    './httpdocs/js/angular/application/modules/xmlmarket/**/*.html'
                ],
                [
                    'xmlmarket/build'
                ]
        );
    }
);
__________________
Чебурашка стал символом олимпийских игр. А чего достиг ты?
Тишина - самый громкий звук
Ответить с цитированием