Skip to content

Commit

Permalink
feat(hippy-vue-example): change dev cssloader path (Tencent#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj authored and boxizen committed Aug 16, 2021
1 parent fdf377c commit 894f991
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/hippy-vue-demo/scripts/hippy-webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const pkg = require('../package.json');

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: 'development',
watch: true,
Expand Down Expand Up @@ -64,7 +75,7 @@ module.exports = {
{
test: /\.css$/,
use: [
'@hippy/vue-css-loader',
cssLoader,
],
},
{
Expand Down

0 comments on commit 894f991

Please sign in to comment.