Skip to content

Commit

Permalink
fix(hippy-vue): fixed vue-css-loader path option for building demo
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj committed Aug 3, 2021
1 parent b48b3f0 commit 22c495b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion examples/hippy-vue-demo/scripts/hippy-webpack.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ const pkg = require('../package.json');
const manifest = require('../dist/android/vendor-manifest.json');

const platform = 'android';
let cssLoader = '@hippy/vue-css-loader';
const hippyVueCssLoaderPath = path.resolve(__dirname, '../../../packages/hippy-vue-css-loader/dist/index.js');
if (fs.existsSync(hippyVueCssLoaderPath)) {
/* eslint-disable-next-line no-console */
console.warn(`* Using the @hippy/vue-css-loader in ${hippyVueCssLoaderPath}`);
cssLoader = hippyVueCssLoaderPath;
} else {
/* eslint-disable-next-line no-console */
console.warn('* Using the @hippy/vue-css-loader defined in package.json');
}

module.exports = {
mode: 'production',
Expand Down Expand Up @@ -53,7 +63,7 @@ module.exports = {
{
test: /\.css$/,
use: [
'@hippy/vue-css-loader',
cssLoader,
],
},
{
Expand Down
12 changes: 11 additions & 1 deletion examples/hippy-vue-demo/scripts/hippy-webpack.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ const pkg = require('../package.json');
const manifest = require('../dist/ios/vendor-manifest.json');

const platform = 'ios';
let cssLoader = '@hippy/vue-css-loader';
const hippyVueCssLoaderPath = path.resolve(__dirname, '../../../packages/hippy-vue-css-loader/dist/index.js');
if (fs.existsSync(hippyVueCssLoaderPath)) {
/* eslint-disable-next-line no-console */
console.warn(`* Using the @hippy/vue-css-loader in ${hippyVueCssLoaderPath}`);
cssLoader = hippyVueCssLoaderPath;
} else {
/* eslint-disable-next-line no-console */
console.warn('* Using the @hippy/vue-css-loader defined in package.json');
}

module.exports = {
mode: 'production',
Expand Down Expand Up @@ -53,7 +63,7 @@ module.exports = {
{
test: /\.css$/,
use: [
'@hippy/vue-css-loader',
cssLoader,
],
},
{
Expand Down

0 comments on commit 22c495b

Please sign in to comment.