Coder Social home page Coder Social logo

Сделать так что бы gulp обрабатывал все файлы js и передавал их в build about gulp-boilerplate HOT 2 CLOSED

IvanovEV92 avatar IvanovEV92 commented on August 28, 2024
Сделать так что бы gulp обрабатывал все файлы js и передавал их в build

from gulp-boilerplate.

Comments (2)

luxplanjay avatar luxplanjay commented on August 28, 2024

Для этого необходимо настроить вебпак с поддержкой многостраничных приложений https://webpack.js.org/concepts/entry-points/#multi-page-application

from gulp-boilerplate.

IvanovEV92 avatar IvanovEV92 commented on August 28, 2024

Вот пока с конфигами беда :( от слова совсем
Возможно Вы сможете подсказать как именно правильно нужно вывать эти самые entry

ниже файл конфига скриптов (если нужно могу всю сборку предоставить)

`const gulp = require('gulp');
const babel = require('gulp-babel');
const mode = require('gulp-mode')();
const fileinclude = require('gulp-file-include');
const paths = require('../paths');
const webpack = require('webpack');
const webpackStream = require('webpack-stream');
const uglify = require('gulp-uglify-es').default;
const scripts = () => {
return gulp
.src(paths.src.js)
.pipe(fileinclude())
.pipe(
webpackStream({
mode: 'development',
output: {
filename: 'scripts.js',
},
module: {
rules: [
{
test: /.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
},
},
{
test: /.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /.(gif|png|jpe?g|svg)$/i,
use: [
{
loader: 'url-loader',
options: {
name: '[path][name].[ext]',
limit: 8192,
esModule: false,
},
},
'img-loader',
],
},
{
test: /.hbs$/,
use: 'handlebars-loader',
},
{
test: /.woff(2)?(?[a-z0-9#=&.]+)?$/,
use: [
{
loader: 'url-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
limit: 10000,
mimetype: 'application/font-woff',
},
},
],
},
{
test: /.(ttf|eot)(?v=\d+.\d+.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
},
},
],
},
],
},
}),
)
.pipe(babel())
.pipe(mode.production(uglify()))
.pipe(gulp.dest(paths.build.js));
};

module.exports = scripts;`

from gulp-boilerplate.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.