Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update webpack 4.0 #26

Merged
merged 14 commits into from
Aug 28, 2018
Merged

update webpack 4.0 #26

merged 14 commits into from
Aug 28, 2018

Conversation

jimexist
Copy link
Contributor

@jimexist jimexist commented Aug 1, 2018

fixes #24

currently blocked by Cap32/wxml-loader#12

@TravisBuddy
Copy link

Travis tests have failed

Hey @jimexist,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8

lerna run test
lerna info version 3.0.0-rc.0
lerna WARN project Deprecated key "commands" found in lerna.json
lerna WARN project Please rename "commands" => "command"
lerna WARN project Deprecated key "command.publish.ignore" found in lerna.json
lerna WARN project Please rename "command.publish.ignore" => "command.publish.ignoreChanges"
lerna info versioning independent
lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'
lerna ERR! npm run test stdout:

> @tinajs/[email protected] test /home/travis/build/tinajs/mina-webpack/packages/mina-loader
> ava test/*.js


lerna ERR! npm run test stderr:

  ✖ json5 › use json5 to parse config Rejected promise returned by test
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:138:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › pack with options 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › basic 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:70:16)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/page.js' }
  ✖ basic › pack multiple files 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:20:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/template/inline.js' }
  ✖ template › inline template Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:93:11)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/header.ae94ef.wxml' }
  ✖ template › include template 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:53:11)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/message.fd0e28.wxml' }
  ✖ template › import template Test finished without running any assertions
  ✖ separation › load separated .ts source file Rejected promise returned by test
  ✖ separation › load separated .es source file Rejected promise returned by test
(node:2662) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
(node:2662) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
  ✖ resolve-components › resolve components Rejected promise returned by test

  10 tests failed

  basic › pack with options

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:134

   133:                                                      
   134:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   135:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  basic › basic

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:18

   17:                                                      
   18:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   19:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  basic › pack multiple files

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:68

   67:                                                      
   68:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   69:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  json5 › use json5 to parse config

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/component.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.fn (test/json5.js:33:30)



  resolve-components › resolve components

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/fixtures/resolve-components/node_modules/memory-fs/lib/MemoryFileSystem.js:107

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/pages/home.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
  Test.fn (test/resolve-components.js:21:30)



  separation › load separated .ts source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/ts-page.js',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.fn (test/separation.js:39:15)



  separation › load separated .es source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/es-page.js',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.fn (test/separation.js:80:15)



  template › inline template


  Test finished without running any assertions



  template › include template

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:91

   90:                                                      
   91:     t.true(mfs.existsSync('/assets/logo.97017d.png'))
   92:     t.is(                                            

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.97017d.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  template › import template


  Test finished without running any assertions

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tinajs/[email protected] test: `ava test/*.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tinajs/[email protected] test 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!     /home/travis/.npm/_logs/2018-08-01T09_36_06_482Z-debug.log

lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'

Node.js: 6

lerna run test
lerna info version 3.0.0-rc.0
lerna WARN project Deprecated key "commands" found in lerna.json
lerna WARN project Please rename "commands" => "command"
lerna WARN project Deprecated key "command.publish.ignore" found in lerna.json
lerna WARN project Please rename "command.publish.ignore" => "command.publish.ignoreChanges"
lerna info versioning independent
 file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › pack with options 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:70:16)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/page.js' }
  ✖ basic › pack multiple files 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:93:11)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/header.ae94ef.wxml' }
  ✖ template › include template 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packagesis deprecated. Use new API on `.hooks` instead
(node:2561) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
  ✖ resolve-components › resolve components Rejected promise returned by test

  10 tests failed

  basic › basic

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:18

   17:                                                      
   18:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   19:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/basic.js:18:5)
  step (test/basic.js:22:191)
  test/basic.js:22:361



  basic › pack with options

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:134

   133:                                                      
   134:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   135:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/basic.js:134:5)
  step (test/basic.js:22:191)
  test/basic.js:22:361



  basic › pack multiple files

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:68

   67:                                                      
   68:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   69:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/basic.js:68:5)
  step (test/basic.js:22:191)
  test/basic.js:22:361



  json5 › use json5 to parse config

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/component.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.<anonymous> (test/json5.js:33:30)
  step (test/json5.js:19:191)
  test/json5.js:19:361



  resolve-components › resolve components

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/fixtures/resolve-components/node_modules/memory-fs/lib/MemoryFileSystem.js:107

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/pages/home.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
  Test.<anonymous> (test/resolve-components.js:21:30)
  step (test/resolve-components.js:21:191)
  test/resolve-components.js:21:361



  separation › load separated .es source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
  : `ava test/*.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tinajs/[email protected] test 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!     /home/travis/.npm/_logs/2018-08-01T09_36_08_157Z-debug.log

lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'

@TravisBuddy
Copy link

Travis tests have failed

Hey @jimexist,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 6

lerna run test
lerna info version 3.0.0-rc.0
lerna WARN project Deprecated key "commands" found in lerna.json
lerna WARN project Please rename "commands" => "command"
lerna WARN project Deprecated key "command.publish.ignore" found in lerna.json
lerna WARN project Please rename "command.publish.ignore" => "command.publish.ignoreChanges"
lerna info versioning independent
lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'
lerna ERR! npm run test stdout:

> @tinajs/[email protected] test /home/travis/build/tinajs/mina-webpack/packages/mina-loader
> ava test/**/*.js


lerna ERR! npm run test stderr:

  ✖ Couldn't find any files to test

  0 tests passed
  1 uncaught exception

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tinajs/[email protected] test: `ava test/**/*.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tinajs/[email protected] test 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!     /home/travis/.npm/_logs/2018-08-01T09_38_33_773Z-debug.log

lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'

/**
* Retrieves the public path from the loader options, context.options (webpack <4) or context._compilation (webpack 4+).
* context._compilation is likely to get removed in a future release, so this whole function should be removed then.
* See: https://github.com/peerigon/extract-loader/issues/35
Copy link
Member

@imyelo imyelo Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking maybe we should add an option (e.g. publicPath) to mina-loader, if we can't access the context.options or context._compilation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although most of the time our users will keep it as "/".

@TravisBuddy
Copy link

Travis tests have failed

Hey @jimexist,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8

lerna run test
lerna info version 3.0.3
lerna info versioning independent
lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'
lerna ERR! npm run test stdout:

> @tinajs/[email protected] test /home/travis/build/tinajs/mina-webpack/packages/mina-loader
> ava test/*.js


lerna ERR! npm run test stderr:

  ✖ json5 › use json5 to parse config Rejected promise returned by test
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › basic 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:138:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › pack with options 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:70:16)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/page.js' }
  ✖ basic › pack multiple files 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:20:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/template/inline.js' }
  ✖ template › inline template Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:53:11)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/message.fd0e28.wxml' }
  ✖ template › import template Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:93:11)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/header.ae94ef.wxml' }
  ✖ template › include template 
  ✖ separation › load separated .es source file Rejected promise returned by test
  ✖ separation › load separated .ts source file Rejected promise returned by test
(node:2649) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
(node:2649) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
  ✖ resolve-components › resolve components Rejected promise returned by test
  ✖ lang › use lang attribute should override loaders options 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:15:11)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/lang/basic.wxss' }
  ✖ lang › use lang attribute simply with loader name Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.fn (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:52:10)
    at <anonymous>
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/lang/custom-rule.js' }
  ✖ lang › use lang attribute with extra rules Test finished without running any assertions

  13 tests failed

  basic › basic

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:18

   17:                                                      
   18:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   19:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  basic › pack with options

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:134

   133:                                                      
   134:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   135:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  basic › pack multiple files

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:68

   67:                                                      
   68:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   69:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }



  json5 › use json5 to parse config

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/component.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.fn (test/json5.js:33:30)



  lang › use lang attribute should override loaders options

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:99

   98:            
   99:     t.true(
   100:       mfs  

  Value is not `true`:

  false

  mfs.readFileSync(/fixtures/lang/override-loader.js,utf8).includes(console.log('yellow'))
  => false

  mfs.readFileSync(/fixtures/lang/override-loader.js,utf8)
  => '!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){n(2)},,function(e,t){Page({onLoad(){console.log("yellow")}})}]);'

  mfs
  => MemoryFileSystem {
    data: {
      fixtures: {
        '': true,
        lang: Object { … },
      },
    },
  }



  lang › use lang attribute simply with loader name


  Test finished without running any assertions



  lang › use lang attribute with extra rules


  Test finished without running any assertions



  resolve-components › resolve components

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/fixtures/resolve-components/node_modules/memory-fs/lib/MemoryFileSystem.js:107

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/pages/home.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
  Test.fn (test/resolve-components.js:21:30)



  separation › load separated .es source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/es-page.js',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.fn (test/separation.js:80:15)



  separation › load separated .ts source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/ts-page.js',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.fn (test/separation.js:39:15)



  template › inline template


  Test finished without running any assertions



  template › import template


  Test finished without running any assertions



  template › include template

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:91

   90:                                                      
   91:     t.true(mfs.existsSync('/assets/logo.97017d.png'))
   92:     t.is(                                            

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.97017d.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tinajs/[email protected] test: `ava test/*.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tinajs/[email protected] test 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!     /home/travis/.npm/_logs/2018-08-12T12_07_14_297Z-debug.log

lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'

Node.js: 6

lerna run test
lerna info version 3.0.3
lerna info versioning independent
lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'
lerna ERR! npm run test stdout:

> @tinajs/[email protected] test /home/travis/build/tinajs/mina-webpack/packages/mina-loader
> ava test/*.js


lerna ERR! npm run test stderr:

  ✖ json5 › use json5 to parse config Rejected promise returned by test
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:10)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › basic 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:138:10)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/basic/page.js' }
  ✖ basic › pack with options 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:70:16)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/page.js' }
  ✖ basic › pack multiple files 
  ✖ separation › load separated .ts source file Rejected promise returned by test
  ✖ separation › load separated .es source file Rejected promise returned by test
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:20:10)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/template/inline.js' }
  ✖ template › inline template Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:53:11)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/message.fd0e28.wxml' }
  ✖ template › import template Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:93:11)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:22:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/wxml/header.ae94ef.wxml' }
  ✖ template › include template 
(node:2645) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
(node:2645) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
  ✖ resolve-components › resolve components Rejected promise returned by test
  ✖ lang › use lang attribute should override loaders options 
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:15:11)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:16:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:16:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/lang/basic.wxss' }
  ✖ lang › use lang attribute simply with loader name Test finished without running any assertions
{ Error: no such file or directory
    at MemoryFileSystem.readFileSync (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
    at Test.<anonymous> (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:52:10)
    at next (native)
    at step (/home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:16:191)
    at /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:16:361
    at process._tickCallback (internal/process/next_tick.js:109:7)
  code: 'ENOENT',
  errno: 34,
  message: 'no such file or directory',
  path: '/fixtures/lang/custom-rule.js' }
  ✖ lang › use lang attribute with extra rules Test finished without running any assertions

  13 tests failed

  basic › basic

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:18

   17:                                                      
   18:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   19:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/basic.js:18:5)
  step (test/basic.js:22:191)
  test/basic.js:22:361



  basic › pack with options

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:134

   133:                                                      
   134:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   135:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/basic.js:134:5)
  step (test/basic.js:22:191)
  test/basic.js:22:361



  basic › pack multiple files

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/basic.js:68

   67:                                                      
   68:     t.true(mfs.existsSync('/assets/logo.7bd732.png'))
   69:                                                      

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.7bd732.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/basic.js:68:5)
  step (test/basic.js:22:191)
  test/basic.js:22:361



  json5 › use json5 to parse config

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/component.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.<anonymous> (test/json5.js:33:30)
  step (test/json5.js:19:191)
  test/json5.js:19:361



  lang › use lang attribute should override loaders options

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/lang.js:99

   98:            
   99:     t.true(
   100:       mfs  

  Value is not `true`:

  false

  mfs.readFileSync(/fixtures/lang/override-loader.js,utf8).includes(console.log('yellow'))
  => false

  mfs.readFileSync(/fixtures/lang/override-loader.js,utf8)
  => '!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){n(2)},,function(e,t){Page({onLoad(){console.log("yellow")}})}]);'

  mfs
  => MemoryFileSystem {
    data: {
      fixtures: {
        '': true,
        lang: Object { … },
      },
    },
  }

  Test.<anonymous> (test/lang.js:99:5)
  step (test/lang.js:16:191)
  test/lang.js:16:361



  lang › use lang attribute simply with loader name


  Test finished without running any assertions



  lang › use lang attribute with extra rules


  Test finished without running any assertions



  resolve-components › resolve components

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/fixtures/resolve-components/node_modules/memory-fs/lib/MemoryFileSystem.js:107

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/pages/home.json',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:107:10)
  Test.<anonymous> (test/resolve-components.js:21:30)
  step (test/resolve-components.js:21:191)
  test/resolve-components.js:21:361



  separation › load separated .ts source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/ts-page.js',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.<anonymous> (test/separation.js:39:15)
  step (test/separation.js:20:191)
  test/separation.js:20:361



  separation › load separated .es source file

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/node_modules/memory-fs/lib/MemoryFileSystem.js:114

  Rejected promise returned by test. Reason:

  Error {
    code: 'ENOENT',
    errno: 34,
    message: 'no such file or directory',
    path: '/es-page.js',
  }

  MemoryFileSystem.readFileSync (node_modules/memory-fs/lib/MemoryFileSystem.js:114:10)
  Test.<anonymous> (test/separation.js:80:15)
  step (test/separation.js:20:191)
  test/separation.js:20:361



  template › inline template


  Test finished without running any assertions



  template › import template


  Test finished without running any assertions



  template › include template

  /home/travis/build/tinajs/mina-webpack/packages/mina-loader/test/template.js:91

   90:                                                      
   91:     t.true(mfs.existsSync('/assets/logo.97017d.png'))
   92:     t.is(                                            

  Value is not `true`:

  false

  mfs.existsSync(/assets/logo.97017d.png)
  => false

  mfs
  => MemoryFileSystem {
    data: {},
  }

  Test.<anonymous> (test/template.js:91:5)
  step (test/template.js:22:191)
  test/template.js:22:361

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tinajs/[email protected] test: `ava test/*.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @tinajs/[email protected] test 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!     /home/travis/.npm/_logs/2018-08-12T12_07_45_263Z-debug.log

lerna ERR! npm run test exited 1 in '@tinajs/mina-loader'

imyelo added 9 commits August 12, 2018 20:11
- use webpack `none` mode for testing
- use @tinajs/wxml-loader instead of wxml-loader temporarily
- use `compiler.hooks[name].tap(...)` instead of `compiler.plugin(name, ...)`
- use `func.apply(compiler)` instead of `compiler.apply(func)`
- update the params of `compiler.hooks.watchRun`
- deprecate `runtime` option
- load filename of runtime and common chunks automaticly
- use `output.globalObject`
@TravisBuddy
Copy link

Hey @jimexist,
Your changes look good to me!

@TravisBuddy
Copy link

Hey @jimexist,
Your changes look good to me!

@TravisBuddy
Copy link

Hey @jimexist,
Your changes look good to me!

@imyelo imyelo merged commit c0b8956 into tinajs:master Aug 28, 2018
@jimexist jimexist deleted the use-webpack-4 branch August 28, 2018 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for Webpack 4
3 participants