motia / quasar-app-extension-onesignal

Adds onesignal push notifications to quasar framework apps.
MIT License
5 stars 5 forks source link

Support for Quasar v2 #2

Closed nestbeatdev closed 4 years ago

nestbeatdev commented 4 years ago

Hi, awesome extension!

But, since many projects will probably be using Quasar v2 from now on, is it possible that you can update it to Quasar v2?

imsus commented 4 years ago

Hi @nestbeatdev

This is Workaround for v2 (involves editing directly in node_modules which is not recommended).

  1. Update api.compatibleWith() to support ^2.0.0 Go to node_modules/quasar-app-extension-onesignal/src/index.js on line 49: https://github.com/motia/quasar-app-extension-onesignal/blob/master/src/index.js#L49

    -api.compatibleWith('@quasar/app', '^1.0.0')
    +api.compatibleWith('@quasar/app', '^2.0.0')
  2. Update the new CopyPlugin() function using new version of Webpack Plugin Copy Go to node_modules/quasar-app-extension-onesignal/src/index.js on line 39: https://github.com/motia/quasar-app-extension-onesignal/blob/master/src/index.js#L39-L45

    -conf.plugins.push(new CopyPlugin([
    {
    from: path.join(__dirname, 'assets', 'root'),
    to: '.',
    transform: (content, path) => swTransformer(mode, path)
    }
    -]))
    +conf.plugins.push(new CopyPlugin({
    +  patterns: [
    {
      from: path.join(__dirname, 'assets', 'root'),
      to: '.',
      transform: (content, path) => swTransformer(mode, path)
    }
    +  ]
    +})
motia commented 4 years ago

Implemented in version 0.3.0, it will support both v2 with BC to v1.