-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removed onResolve and namespaces * cross env fixes * issue 48 leftovers
- Loading branch information
Showing
32 changed files
with
318 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,4 @@ lib/ | |
*.iml | ||
|
||
.idea/ | ||
/.nyc_output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import "../../node_modules/bootstrap/scss/bootstrap"; | ||
|
||
body { | ||
padding: 1em; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule 48
deleted from
c8680f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
!/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const path = require('path') | ||
const esbuild = require('esbuild') | ||
const { sassPlugin, postcssModules } = require('../../../lib') | ||
|
||
const build = async () => { | ||
const isProd = process.env.NODE_ENV === 'production' | ||
|
||
const result = await esbuild.build({ | ||
platform: 'browser', | ||
entryPoints: [`${__dirname}/src/index.js`], | ||
publicPath: '/', | ||
outdir: `${__dirname}/build`, | ||
legalComments: 'external', | ||
bundle: true, | ||
treeShaking: true, | ||
minify: isProd, | ||
write: true, | ||
format: 'esm', | ||
loader: { | ||
'.js': 'jsx', | ||
// '.jsx': 'jsx', | ||
// '.ts': 'ts', | ||
// '.tsx': 'ts', | ||
'.png': 'file', | ||
'.jpg': 'file', | ||
'.jpeg': 'file', | ||
'.svg': 'file', | ||
'.woff2': 'file', | ||
'.ttf': 'file' | ||
}, | ||
target: 'es2018', | ||
plugins: [ | ||
sassPlugin({ | ||
// outputStyle: isProd ? 'compressed' : 'expanded', | ||
// transform: postcssModules({ | ||
// // ...put here the options for postcss-modules: https://github.com/madyankin/postcss-modules | ||
// }) | ||
precompile(source, pathname) { | ||
console.log("precompile:", pathname) | ||
return source.replace(/(url\(['"]?)(\.\.?\/)([^'")]+['"]?\))/g, `$1${path.dirname(pathname)}/$2$3`) | ||
} | ||
}) | ||
] | ||
}) | ||
} | ||
|
||
build() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@font-face { | ||
font-family: 'Nunito Sans'; | ||
src: url('./NunitoSans-Light.ttf'); | ||
font-weight: 400; | ||
font-style: normal; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: #ccc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "issue-48", | ||
"version": "1.0.0", | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$bgColor: #ccc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import './TestComponent.scss' | ||
|
||
console.info('Hello from TestComponent') |
5 changes: 5 additions & 0 deletions
5
test/issues/48/src/components/TestComponent/TestComponent.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import '../../variables.scss'; | ||
|
||
body { | ||
background: $bgColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import './style.scss' | ||
|
||
import './components/TestComponent/TestComponent' | ||
|
||
console.info('Hello world') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import '../fonts/fonts.scss'; | ||
|
||
html.darkMode { | ||
@import '../lib/SomeLib/builtIn'; // Note the extension should not be added, this is intended to use namespace feature | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const {build} = require("esbuild"); | ||
const {sassPlugin} = require("../../../lib"); | ||
const path = require("path"); | ||
const {cleanFixture, logSuccess, logFailure} = require('../../fixture/utils') | ||
|
||
cleanFixture(__dirname) | ||
|
||
let last; | ||
|
||
build({ | ||
entryPoints: ["src/index.jsx"], | ||
outdir: "out", | ||
bundle: true, | ||
plugins: [ | ||
sassPlugin({}) | ||
] | ||
}).then(logSuccess, logFailure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Issue 61</title> | ||
<link rel="stylesheet" href="out/index.css"> | ||
</head> | ||
<body> | ||
<h1>TODO: THIS TEST IS WIP</h1> | ||
<div id="app"></div> | ||
<script src="out/index.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "issue-61", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"swiper": "^7.4.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import Swiper, {Navigation, Pagination} from 'swiper'; | ||
import 'swiper/scss'; | ||
|
||
import 'swiper/scss/navigation'; | ||
import 'swiper/css/pagination'; | ||
|
||
Swiper.use([Navigation, Pagination]); | ||
|
||
function App() { | ||
return ( | ||
<div className="swiper"> | ||
<div className="swiper-wrapper"> | ||
<div className="swiper-slide">Slide 1</div> | ||
<div className="swiper-slide">Slide 2</div> | ||
<div className="swiper-slide">Slide 3</div> | ||
</div> | ||
<div className="swiper-pagination"/> | ||
<div className="swiper-button-prev"/> | ||
<div className="swiper-button-next"/> | ||
<div className="swiper-scrollbar"/> | ||
</div> | ||
) | ||
} | ||
|
||
ReactDOM.render(<App/>, document.querySelector("#app")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.