wrench: Switch (back) to webpack for compilation
This commit is contained in:
parent
ba2729811d
commit
5e7c8f110a
6 changed files with 3427 additions and 633 deletions
|
@ -7,13 +7,13 @@
|
|||
<body>
|
||||
<div id="svg"></div>
|
||||
<script type="text/javascript" src="freesewing.js"></script>
|
||||
<script type="text/javascript" src="dist/browser.js"></script>
|
||||
<script type="text/javascript" src="dist/module.js"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-theme"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-designer"></script>
|
||||
<script>
|
||||
var pattern = freesewing.patterns.brian
|
||||
var pattern = brian
|
||||
.with(freesewing.plugins.theme)
|
||||
.with(freesewing.plugins.designer);
|
||||
//.with(freesewing.plugins.designer);
|
||||
|
||||
pattern.settings.measurements = {
|
||||
bicepsCircumference: 335,
|
||||
|
@ -29,7 +29,7 @@
|
|||
};
|
||||
pattern.settings.mode = 'draft';
|
||||
pattern.on('preRenderSvg', function(next) {
|
||||
this.attributes.add('viewBox', '-10 -10 400 600');
|
||||
this.attributes.add('viewBox', '-10 -10 500 600');
|
||||
next();
|
||||
});
|
||||
pattern.draft();
|
||||
|
|
3961
packages/brian/package-lock.json
generated
3961
packages/brian/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -24,10 +24,10 @@
|
|||
"clean": "rimraf dist",
|
||||
"pretty": "npx prettier --write \"src/*.js\"",
|
||||
"lint": "eslint --fix \"src/*.js\"",
|
||||
"watch": "rollup -w -c rollup.browser.js",
|
||||
"watch": "npx webpack --watch",
|
||||
"browserbuild": "rollup -c rollup.browser.js",
|
||||
"nodebuild": "rollup -c rollup.node.js",
|
||||
"build": "npm run clean && npm run browserbuild && npm run nodebuild"
|
||||
"build": "npx webpack"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
@ -42,13 +42,17 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@freesewing/plugin-cutonfold": "^0.5.0",
|
||||
"@freesewing/plugin-logo": "^0.1.2",
|
||||
"@freesewing/plugin-logo": "^0.1.3",
|
||||
"@freesewing/plugin-title": "^0.3.2",
|
||||
"freesewing": "^0.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0-beta.54",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.54",
|
||||
"@babel/preset-env": "^7.0.0-beta.54",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-loader": "^8.0.0-beta.4",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"eslint": "^5.2.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
|
@ -57,13 +61,8 @@
|
|||
"lint-staged": "^7.2.0",
|
||||
"prettier": "^1.13.7",
|
||||
"rimraf": "^2.6.2",
|
||||
"rollup": "0.63.4",
|
||||
"rollup-plugin-babel": "^3.0.7",
|
||||
"rollup-plugin-commonjs": "^9.1.3",
|
||||
"rollup-plugin-filesize": "^4.0.1",
|
||||
"rollup-plugin-json": "^3.0.0",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-terser": "^1.0.1"
|
||||
"webpack": "^4.16.2",
|
||||
"webpack-cli": "^3.1.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
|
|
@ -44,10 +44,10 @@ var back = {
|
|||
points.armholePitch.x / 2,
|
||||
points.armholePitch.y
|
||||
);
|
||||
macro("title", {
|
||||
at: points.title,
|
||||
nr: 2
|
||||
});
|
||||
macro("title", { at: points.title, nr: 2 });
|
||||
|
||||
points.logo = points.title.shift(-90, 100);
|
||||
snippets.logo = new F.snippet("logo", points.logo);
|
||||
};
|
||||
|
||||
if (final) {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import freesewing from "freesewing";
|
||||
import cutonfold from "@freesewing/plugin-cutonfold";
|
||||
import * as plugintitle from "@freesewing/plugin-title";
|
||||
//import logo from "@freesewing/plugin-logo";
|
||||
import title from "@freesewing/plugin-title";
|
||||
import logo from "@freesewing/plugin-logo";
|
||||
import config from "../config/config";
|
||||
import back from "./back";
|
||||
import { version } from "../package.json";
|
||||
console.log("title is ", plugintitle);
|
||||
console.log("logo is", logo);
|
||||
var pattern = new freesewing.pattern({ version: version, ...config })
|
||||
.with(cutonfold)
|
||||
.with(plugintitle);
|
||||
// .with(logo)
|
||||
.with(title)
|
||||
.with(logo);
|
||||
//pattern.on("preRenderSvg", function(next) {
|
||||
// this.attributes.add(`freesewing:${name}`, version);
|
||||
// next();
|
||||
|
@ -21,4 +21,4 @@ pattern.draft = function() {
|
|||
return pattern;
|
||||
};
|
||||
|
||||
export default pattern;
|
||||
module.exports = pattern;
|
||||
|
|
32
packages/brian/webpack.config.js
Normal file
32
packages/brian/webpack.config.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
mode: "development",
|
||||
entry: "./src/index.js",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
filename: "module.js",
|
||||
libraryTarget: "var",
|
||||
library: "brian"
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [path.resolve(__dirname, "src")],
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
presets: ["@babel/preset-env"],
|
||||
plugins: [require("@babel/plugin-proposal-object-rest-spread")]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
devtool: "source-map",
|
||||
target: "web",
|
||||
externals: ["freesewing"],
|
||||
serve: {
|
||||
port: 8080,
|
||||
content: "./index.html"
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue