@codedesignai/nextjs-live-edit-plugin 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -29,18 +29,14 @@ const path = require('path');
29
29
  */
30
30
  function withLiveEdit(nextConfig = {}, pluginOptions = {}) {
31
31
  const sourceDirs = pluginOptions.sourceDirs || ['app', 'components', 'src'];
32
-
33
- // Only add source mapping in development mode
34
- if (process.env.NODE_ENV === 'production') {
35
- return nextConfig;
36
- }
32
+ const projectRoot = pluginOptions.projectRoot || process.cwd();
37
33
 
38
34
  const loaderPath = path.resolve(__dirname, 'source-mapper-loader.js');
39
35
  const loaderConfig = {
40
36
  loader: loaderPath,
41
37
  options: {
42
38
  sourceDirs,
43
- projectRoot: process.cwd(),
39
+ projectRoot,
44
40
  },
45
41
  };
46
42
 
@@ -54,6 +50,7 @@ function withLiveEdit(nextConfig = {}, pluginOptions = {}) {
54
50
  ...existingTurbopack,
55
51
  rules: {
56
52
  ...existingRules,
53
+ // Apply our source mapper loader to JSX and TSX files
57
54
  '*.jsx': {
58
55
  loaders: [loaderConfig],
59
56
  },
@@ -538,16 +538,6 @@ function createLiveEditHandler(options = {}) {
538
538
  };
539
539
 
540
540
  async function POST(request) {
541
- // Only allow in development
542
- if (process.env.NODE_ENV === 'production') {
543
- return new Response(
544
- JSON.stringify({
545
- success: false,
546
- error: 'Live editing is only available in development mode',
547
- }),
548
- { status: 403, headers: { 'Content-Type': 'application/json', ...corsHeaders } }
549
- );
550
- }
551
541
 
552
542
  try {
553
543
  const data = await request.json();
@@ -614,12 +604,6 @@ function createPagesApiHandler(options = {}) {
614
604
  return;
615
605
  }
616
606
 
617
- if (process.env.NODE_ENV === 'production') {
618
- res
619
- .status(403)
620
- .json({ success: false, error: 'Live editing is only available in development mode' });
621
- return;
622
- }
623
607
 
624
608
  try {
625
609
  const data = req.body;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codedesignai/nextjs-live-edit-plugin",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Next.js plugin for live editing React components with AST-powered source mapping",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -146,11 +146,6 @@ function extractStringFromAttrValue(valueNode) {
146
146
  * - Inline backgroundImage styles
147
147
  */
148
148
  module.exports = function sourceMapperLoader(source) {
149
- // Only run in development mode
150
- if (process.env.NODE_ENV === 'production') {
151
- return source;
152
- }
153
-
154
149
  const resourcePath = this.resourcePath;
155
150
  const options = this.getOptions() || {};
156
151