Size: a a a

Webpack — русскоговорящее сообщество

2019 October 25

ks

kam sant in Webpack — русскоговорящее сообщество
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
you dont have js loader
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
so webpack cant load js
источник

ks

kam sant in Webpack — русскоговорящее сообщество
Роман Лапин
you dont have js loader
npm i loader
источник

ks

kam sant in Webpack — русскоговорящее сообщество
then and only i do that
источник

ks

kam sant in Webpack — русскоговорящее сообщество
?
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
kam sant
npm i loader
webpack config -> rules
{
               test: /\.js$/,
               loader: 'babel-loader',
               exclude: file => (
                   /node_modules/.test(file)
                   && !/\.vue\.js/.test(file)
               ),
           },
источник

ks

kam sant in Webpack — русскоговорящее сообщество
módulo: {
       regras: [{
           teste: /\.s?[acѕss$/,
           usar: [
               MiniCssExtractPlugin.loader,
               'css-loader',
                'sass-loader',
           ]
       }}, {
           teste: / \. (png | svg | jpg | gif) $ /,
           use: ['carregador de arquivos']

       }, {
           teste: /.(ttf|otf|svg|woff(2)?)$/,
           use: ['carregador de arquivos']
       }, {
               teste: /\.js$/,
               loader: 'babel-loader',
               excluir: arquivo => (
                   /node_modules/.test(file)
                   &&! / \. vue \ .js / .test (arquivo)
               ),
           },]
   }
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
yes
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
and you need to
npm i babel-loader -S
источник

z

z̛e͏́͠r͜c҉ in Webpack — русскоговорящее сообщество
Это что итальянский диалект для webpack конфига завезли ?
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
скорее испанский)
источник

ks

kam sant in Webpack — русскоговорящее сообщество
Роман Лапин
webpack config -> rules
{
               test: /\.js$/,
               loader: 'babel-loader',
               exclude: file => (
                   /node_modules/.test(file)
                   && !/\.vue\.js/.test(file)
               ),
           },

C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01>npm i babel-loader -S
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN rm not removing C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\.bin\semver.cmd as it wasn't installed by C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\semver
npm WARN rm not removing C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\.bin\semver as it wasn't installed by C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\semver
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN babel-loader@8.0.6 requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ babel-loader@8.0.6
added 55 packages from 49 contributors, removed 40 packages, updated 813 packages and audited 10682 packages in 1117.738s
found 9 vulnerabilities (8 moderate, 1 high)
 run npm audit fix to fix them, or npm audit for details

C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01>
C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01>npm run build

> pratica1@1.0.0 build C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01
> cross-env NODE_ENV=production webpack

Hash: b801d4710412aa434f4d
Version: webpack 4.41.2
Time: 2340ms
Built at: 2019-10-25 12:32:38 PM
1 asset
Entrypoint main = app.js
[0] ./src/index.js 3.37 KiB {0} [not cacheable] [built] [failed] [1 error]

ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '@babel/core'
babel-loader@8 requires Babel 7.x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'.
   at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
   at Function.Module._load (internal/modules/cjs/loader.js:562:25)
   at Module.require (internal/modules/cjs/loader.js:692:17)
   at require (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
   at Object.<anonymous> (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\babel-loader\lib\index.js:10:11)
   at Module._compile
источник

ks

kam sant in Webpack — русскоговорящее сообщество
Роман Лапин
webpack config -> rules
{
               test: /\.js$/,
               loader: 'babel-loader',
               exclude: file => (
                   /node_modules/.test(file)
                   && !/\.vue\.js/.test(file)
               ),
           },
(C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
   at Module.load (internal/modules/cjs/loader.js:653:32)
   at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
   at Function.Module._load (internal/modules/cjs/loader.js:585:3)
   at Module.require (internal/modules/cjs/loader.js:692:17)
   at require (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
   at loadLoader (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\loader-runner\lib\loadLoader.js:18:17)
   at iteratePitchingLoaders (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
   at runLoaders (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\loader-runner\lib\LoaderRunner.js:365:2)
   at NormalModule.doBuild (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\NormalModule.js:295:3)
   at NormalModule.build (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\NormalModule.js:446:15)
   at Compilation.buildModule (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\Compilation.js:739:10)
   at moduleFactory.create (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\Compilation.js:1111:12)
   at factory (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\NormalModuleFactory.js:409:6)
   at hooks.afterResolve.callAsync (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\NormalModuleFactory.js:155:13)
   at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
   at AsyncSeriesWaterfallHook.lazyCompileHook (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\tapable\lib\Hook.js:154:20)
   at resolver (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\NormalModuleFactory.js:138:29)
   at process.nextTick (C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\webpack\lib\NormalModuleFactory.js:346:9)
   at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! pratica1@1.0.0 build: cross-env NODE_ENV=production webpack
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the pratica1@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\adm\AppData\Roaming\npm-cache\_logs\2019-10-25T15_32_39_307Z-debug.log

C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01>
источник

ks

kam sant in Webpack — русскоговорящее сообщество
module: {
       rules: [{
           test: /\.s?[ac]ss$/,
           use: [
               MiniCssExtractPlugin.loader,
               'css-loader',
                'sass-loader',
           ]
       }, {
           test:  /\.(png|svg|jpg|gif)$/,
           use: ['file-loader']

       },{
           test:  /.(ttf|otf|svg|woff(2)?)$/,
           use: ['file-loader']
       }, {
           test: /\.js$/,
           loader: 'babel-loader',
           exclude: file => (
               /node_modules/.test(file)
               && !/\.vue\.js/.test(file)
           ),
       }]
   }
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
npm install -D @babel/core
источник

ks

kam sant in Webpack — русскоговорящее сообщество
ok
источник

ks

kam sant in Webpack — русскоговорящее сообщество
Роман Лапин
npm install -D @babel/core
C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01>npm install -D @babel/core

> node-sass@4.9.0 install C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\adm\AppData\Roaming\npm-cache\node-sass\4.9.0\win32-x64-64_binding.node

> node-sass@4.9.0 postinstall C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @babel/core@7.6.4
added 26 packages from 50 contributors, updated 18 packages and audited 10879 packages in 140.364s
found 9 vulnerabilities (8 moderate, 1 high)
 run npm audit fix to fix them, or npm audit for details

C:\Users\adm\Documents\praticaBootstrap\bootstrapPratica01>
источник

РЛ

Роман Лапин in Webpack — русскоговорящее сообщество
kam sant
ok
is it building now?
источник

ks

kam sant in Webpack — русскоговорящее сообщество
error
источник