Answer the question
In order to leave comments, you need to log in
How and on what to write a plugin/module?
Hello
There is a component with the following structure (simplified):
-component(folder)
-icons(folder)
-component.jsx
-component.scss
import React from 'react';
import css from './component.scss';
class Component extends React.Component{
render(){
return(
<div className={css.root}>
</div>
);
}
}
export default Component;
Answer the question
In order to leave comments, you need to log in
An ordinary batch file can do just fine.
An example of generating a basic gulp project for me
gulpbase.bat
@ECHO OFF
>package.json echo {
>>package.json echo "name": "npm_package",
>>package.json echo "version": "1.0.0",
>>package.json echo "main": "index.js",
>>package.json echo "author": "",
>>package.json echo "license": "ISC",
>>package.json echo "devDependencies": {
>>package.json echo "gulp": "*",
>>package.json echo "gulp-concat": "*",
>>package.json echo "gulp-minify-css": "*",
>>package.json echo "gulp-uglify": "*",
>>package.json echo "gulp-html-replace": "*"
>>package.json echo }
>>package.json echo }
>gulpfile.js echo var gulp = require('gulp'),
>>gulpfile.js echo minifyCSS = require('gulp-minify-css'), // Минификация CSS
>>gulpfile.js echo uglify = require('gulp-uglify'), // Минификация JS
>>gulpfile.js echo concat = require('gulp-concat'); // Склейка файлов
>>gulpfile.js echo htmlreplace = require('gulp-html-replace')
>>gulpfile.js echo.
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('html', function() {
>>gulpfile.js echo gulp.src(['../index.html'])
>>gulpfile.js echo .pipe(htmlreplace({
>>gulpfile.js echo 'css': ['css/main.min.css'],
>>gulpfile.js echo 'js': ['//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', '//cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js', 'js/main.min.js]'
>>gulpfile.js echo }))
>>gulpfile.js echo .pipe(gulp.dest('dist/'));
>>gulpfile.js echo });
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('css', function() {
>>gulpfile.js echo return gulp.src(['../normalize.css', '../main.css'])
>>gulpfile.js echo .pipe(concat('main.css'))
>>gulpfile.js echo .pipe(minifyCSS({
>>gulpfile.js echo compatibility: 'ie8'
>>gulpfile.js echo }))
>>gulpfile.js echo .pipe(gulp.dest('build/css'))
>>gulpfile.js echo });
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('js', function() {
>>gulpfile.js echo return gulp.src(['../main.js'])
>>gulpfile.js echo .pipe(concat('main.js'))
>>gulpfile.js echo .pipe(uglify())
>>gulpfile.js echo .pipe(gulp.dest('build/js'))
>>gulpfile.js echo });
>>gulpfile.js echo.
>>gulpfile.js echo.
>>gulpfile.js echo gulp.task('default', ['css', 'js', 'html']);
gulpupdate.bat
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question