-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Julien edited this page Mar 2, 2023
·
9 revisions
- Please fork the project
-
npm install
to install node modules (⚠️ if you are using npm v7, runnpm i --legacy-peer-deps
to avoid loading peer deps) -
npm run build
to build the library using rollup -
npm pack
to generate a tarball similar to what gets uploaded to npmjs
To test the library you should create a new vue project and set it up:
-
vue.config.js:
module.exports = { devServer: { host: 'url of your project on sections.geeks.solutions/login', https: true }, chainWebpack: config => config.resolve.symlinks(false) };
-
package.json
Note: Make sure to run the following command after this adjustmentdependencies:{ "vue-sections": "file://{local_path_of_your_vue_section_tarball_generated_on_step_4_above}" }
npm install
-
Library setup
Follow the setup instruction on Readme.
Then make sure to have the library point to Sections' test URL.
You do that by supplying the following option to the Vue.use instruction:environment
:testing
(note: the type of the string is important, some dev reported that providing it as"testing"
didn't work and they had to load it from an env. variable, i.eapp.$env.YOUR_VAR_NAME
in a nuxt project) -
config
If you want to make adjustments on how project specific components are handled by the library, following the setup to configure the config folder and put components there
Then as you are editing the codebase of the library, you have to repeat the following steps:
On the library
npm run build
-
npm pack
on the library to generate a new tarball
On the host project
-
rm -rf @geeks-solutions/vue-sections
at the root of the host project, to remove the unpacked library - Delete the entry for @geeks-solutions/vue-sections in the
package-lock.json
-
npm install
to download the new tarball and install it afresh
Then you can test your changes in the host project
If you are working on the publication of the library on npm, keep in mind to always run run build
before publishing
npm run build
npm publish