🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

zq-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zq-cli - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+30
bin/index.js
#!/usr/bin/env node
const fs = require('fs');
const ejs = require('ejs');
/**
* 复制文件到指定位置
* @param {string} path1 源位置
* @param {string} path2 目标位置
*/
const copy = ( path1, path2 )=>{
ejs.renderFile( path1, (err, str) => {
fs.writeFile( path2, str, ( err )=>{
if(err) return console.error(err);
console.log('写入成功', path2 );
})
})
}
copy( `${__dirname}/../webpack.config.js`, `webpack.config.js`);
copy( `${__dirname}/../tsconfig.json`, `tsconfig.json`);
copy( `${__dirname}/../postcss.config.js`, `postcss.config.js`);
copy( `${__dirname}/../package.json`, `package.json`);
copy( `${__dirname}/../package-lock.json`, `package-lock.json`);
fs.mkdir( './src', ( err )=>{
if(err) return console.error(err);
copy( `${__dirname}/../src/index.html`, `./src/index.html`);
copy( `${__dirname}/../src/index.scss`, `./src/index.scss`);
copy( `${__dirname}/../src/index.ts`, `./src/index.ts`);
})
!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){console.log("hello webpack")}]);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<div>测试</div>
<script type="text/javascript" src="bundle.js?b61e93ec57f914a37f87"></script></body>
</html>
const autoprefixer = require('autoprefixer');
module.exports = {
plugins: [
autoprefixer({ browsers: ['ie>=8', '>1% in CN'] }),
]
}
body{
width: 100px;
height: 100px;
border: 1px solid #000;
transform: translate(50%,50%);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div>测试</div>
</body>
</html>
body{
width: 100px;
height: 100px;
border: 1px solid #000;
transform: translate(50%,50%);
}
import { Component } from "react";
console.log( Component )
console.log('hello webpack');
require("./index.scss");
let a = ( c = 123 ) => c ;
console.log(a);
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/",
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"allowJs": true
}
}
export namespace Children {
function count(children: any): any;
function forEach(children: any, forEachFunc: any, forEachContext: any): any;
function map(children: any, func: any, context: any): any;
function only(children: any): any;
function toArray(children: any): any;
}
export class Component {
constructor(props: any, context: any, updater: any);
props: any;
context: any;
refs: any;
updater: any;
forceUpdate(callback: any): void;
setState(partialState: any, callback: any): void;
}
export const Fragment: symbol;
export class PureComponent {
constructor(props: any, context: any, updater: any);
props: any;
context: any;
refs: any;
updater: any;
forceUpdate(callback: any): void;
setState(partialState: any, callback: any): void;
}
export const StrictMode: symbol;
export const Suspense: symbol;
export function cloneElement(element: any, props: any, children: any, ...args: any[]): any;
export function createContext(defaultValue: any, calculateChangedBits: any): any;
export function createElement(type: any, props: any, children: any, ...args: any[]): any;
export function createFactory(type: any): any;
export function createRef(): any;
export function forwardRef(render: any): any;
export function isValidElement(object: any): any;
export function lazy(ctor: any): any;
export function memo(type: any, compare: any): any;
export const unstable_ConcurrentMode: symbol;
export const unstable_Profiler: symbol;
export function useCallback(callback: any, inputs: any): any;
export function useContext(Context: any, unstable_observedBits: any, ...args: any[]): any;
export function useDebugValue(value: any, formatterFn: any): any;
export function useEffect(create: any, inputs: any): any;
export function useImperativeHandle(ref: any, create: any, inputs: any): any;
export function useLayoutEffect(create: any, inputs: any): any;
export function useMemo(create: any, inputs: any): any;
export function useReducer(reducer: any, initialArg: any, init: any): any;
export function useRef(initialValue: any): any;
export function useState(initialState: any): any;
export const version: string;
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: './src/index.ts',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
devServer: {
contentBase: './dist',
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
hash: true,
inject: true,
minify: {
removeComments: true
}
}),
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css",
})
],
module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"postcss-loader",
"sass-loader",
]
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192
}
}
]
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
}
}
+30
-4
{
"name": "zq-cli",
"version": "1.0.0",
"version": "1.0.1",
"description": "白大汪的前端构建工具",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack",
"start": "webpack-dev-server --open"
},
"bin": {
"zq-cli": "index.js"
"zq-cli": "bin/index.js"
},
"author": "zouqin",
"license": "ISC"
"license": "ISC",
"dependencies": {
"autoprefixer": "^9.5.1",
"clean-webpack-plugin": "^2.0.1",
"css-loader": "^2.1.1",
"lodash": "^4.17.11",
"node-sass": "^4.11.0",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"ts-loader": "^5.3.3",
"typescript": "^3.4.3",
"webpack": "^4.30.0"
},
"devDependencies": {
"@types/node": "^11.13.4",
"@types/react": "^16.8.13",
"ejs": "^2.6.1",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.6.0",
"react": "^16.8.6",
"url-loader": "^1.1.2",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.3.1"
}
}
-2
#!/usr/bin/env node
console.log('Hello zq-cli');